Ch 7 · Evaluating a Model Honestly · Machine Learning & AI
Topic 7 of 13 in Machine Learning & AI — Foundations — 2 lessons.
Accuracy and Its Limits
Accuracy is the share of correct predictions. Simple, but dangerous on imbalanced data: if 99% of emails are not-spam, a model that says "never spam" scores 99% while being useless.
Precision, Recall & F1
When accuracy lies, split the errors apart: precision asks how many of your positive predictions were right, while recall asks how many of the real positives you actually found. Which one matters more depends on which mistake is costlier. The example counts true positives, false positives and false negatives to work out the scores. In the first model, one false alarm and one miss pull precision and recall down to 0.75 each, so F1 is 0.75 too. The second, over-cautious model has perfect precision but finds only 1 of the 4 real positives, and its F1 of 0.4 shows that one great score cannot hide a bad one.
All topics in Machine Learning & AI Beginner
- What Is Machine Learning?
- Data — Features, Labels & Splitting
- Linear Regression — Fitting a Line
- How Models Learn — Gradient Descent
- Classification — Predicting Categories
- Decision Trees
- Evaluating a Model Honestly
- Overfitting & the Bias-Variance Tradeoff
- The ML Workflow
- Mini-Project — A Spam Classifier
- Clustering — Finding Groups Without Labels
- Your First Real scikit-learn Model
- Words as Numbers — A Taste of NLP