mirror of
https://github.com/rohitg00/ai-engineering-from-scratch.git
synced 2026-10-02 01:54:39 +08:00
Multinomial Naive Bayes from scratch with Laplace smoothing, logistic regression with L2 regularization, and negation scoping (prefix tokens after not/no/never with NOT_ until the next punctuation). Demonstrates the classical canonical text-classification stack. Pedagogically important: the demo output intentionally shows two misclassifications on a tiny training set. The reader sees realistic small-corpus Naive Bayes failure modes tied directly to what bigrams and larger corpora would fix. This is the teaching point, not a bug. Ship artifact: sentiment-baseline prompt with explicit refusals for dropping stopwords on sentiment tasks and for reporting accuracy alone on imbalanced data. ~75 minutes. Prerequisites phase 2/14 Naive Bayes.