Reading the Model's Predictions
Interpret class probabilities.
Reading the Model's Predictions is a free NLP Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the NLP Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Beyond the Label
A model gives you more than a single answer. Learning to read its predictions tells you not just what it chose, but how confident it was.
The Hard Prediction
Calling predict returns the single most likely class for each input. This is the hard label, the model committing to one answer.
print(model.predict(X_new))Probabilities Tell More
Use predict_proba to see the chance assigned to each class. A 0.95 spam score means far more conviction than a borderline 0.51.
print(model.predict_proba(X_new))Rows Sum to One
Each row of probabilities adds up to exactly 1. The model splits all its belief across the available classes, never more and never less.
Know Your Class Order
Probability columns follow the order in classes_. Check that attribute so you know which column means spam and which means ham.
print(model.classes_)Watch the Log Scale
Internally the model works in logs to avoid tiny numbers underflowing. The predict_log_proba method exposes those raw log scores if you need them.
Confidence Is Not Truth
A high probability means the model is sure, not that it is right. Naive Bayes can be overconfident, so treat its numbers with healthy caution.
Tune Your Threshold
You need not flag spam at 0.5. Raising the threshold to 0.8 means fewer false alarms but a few more spam messages slipping through.
spam_prob = model.predict_proba(X_new)[:, 1]
flag = spam_prob > 0.8Inspect the Mistakes
Find inputs where the model was confident yet wrong. These errors often reveal missing words or labels that need fixing in your data.
Explain a Decision
For Naive Bayes you can list which words pushed a message toward spam. That word-level evidence makes the model pleasantly easy to explain. 🔎
From Numbers to Action
Probabilities let you sort by risk, route the unsure cases to a human, and set smart cutoffs. Reading them well turns a model into a real tool.
Quick Check
Which method reveals how confident the model is in each class?
Recap
You moved beyond hard labels to read probabilities, check class order, tune thresholds, and explain decisions. That is how you trust a classifier. ✅
Frequently asked questions
Is the “Reading the Model's Predictions” lesson free?
Yes — the full text of “Reading the Model's Predictions” is free to read here on the web, and the NLP Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the NLP Academy course, upgrade to CoddyKit PRO.
What will I learn in “Reading the Model's Predictions”?
Interpret class probabilities. You practise NLP Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start NLP Academy?
No prior experience is required. NLP Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Reading the Model's Predictions” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this NLP Academy lesson?
Yes. Every NLP Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- The Intuition Behind Naive Bayes
- Building a Spam Detector
- Multinomial vs Bernoulli Models
- Reading the Model's Predictions