Lesson 4: One object you can fit, test, save and hand over
Module 3 · Lesson 4 · About 30 minutes · Needs: Lessons 1 to 3 of this module (splits, logistic regression, accuracy)
The situation
Dev wants the ticket classifier behind an internal endpoint, so the support tool can ask it for a category. "Send me the model," he says. You look at your notebook. The model is a logistic regression. It only understands word scores, and those come from a vectoriser fitted in a different cell. Send one without the other and the predictions are wrong, and nothing says so.
This lesson shows how scikit-learn is organised, then packs every step into one object that can be fitted, cross-validated, saved and loaded by Dev. The data is the same 40 labelled tickets, and one new ticket from Aisha Rahman is traced through every step: "My vacuum dock stopped working after six months."