Lesson 4: Logistic regression: weighted evidence you can read
56 min read·14 Oct 2026
Module 4 · Lesson 4 · About 50 minutes · Needs: basic Python; Lessons 1 to 3 of this module help (word counts, TF-IDF, naive Bayes) but are not required
The situation
It is Monday 28 September 2026, project week 4. The rule router from Module 1 is still the only thing routing Tidewell's inbox, and on Ines's 80 hand-written test messages it is right less than half the time. Rosa wants a trained classifier that beats it. Ines adds a condition: when the model sends a message to Dev or Callum, she wants to see why.
One message runs through the lesson: HT35 from the hand-written test set (simulated). It reads "Charged twice. £45 and £45. Fix it." Ines labels it returns_refund. The rule router sends it to order_status, because none of its keywords appears.