Trusting the result / 7 of 7
Evaluating machine-learning models
What you’ll learn
- Explain the main idea of “Evaluating machine-learning models” in your own words.
- Trace a concrete example and identify the assumptions behind it.
- Apply the principle in a practice problem and recognize a common failure.
The idea, intuitively
Evaluation turns a vague claim of quality into measurable evidence. Accuracy counts correct predictions, but it can hide failure on rare classes. Choose metrics according to which mistakes are costly.
Think of the dataset as a sample from a larger environment. A useful model must transfer beyond that sample. Keep training choices separate from final evaluation, and compare against a simple baseline. Before selecting an algorithm, inspect what the labels mean and which errors matter to the user.
Under the hood
Precision is TP/(TP+FP); recall is TP/(TP+FN). A confusion matrix exposes error types. Compare models on the same held-out examples and report uncertainty when data is limited.
A 99% accurate model can be useless if 99% of cases belong to one class.
A worked example
For 10 true alerts, 5 false alerts, and 2 missed positives, precision is 10/15 and recall is 10/12.
How to use this way of thinking
Define the target, split the data, fit preprocessing only on training examples, and evaluate a baseline. Inspect individual failures alongside aggregate metrics. Change one major choice at a time and use validation evidence to decide whether the additional complexity earns its place.
Try it yourself
A model predicts no fraud in 1,000 cases with 10 fraudulent transactions. Find accuracy and fraud recall.
Key takeaways
- Recall
- A 99% accurate model can be useless if 99% of cases belong to one class.
- Check the assumptions with a small example before applying this idea to a larger system.
Check your understanding
Use feedback to learn. Quiz scores and lesson completion are tracked separately.
Go to lesson completionFurther reading
Original papers and reference material for this school. External resources may be in English and require internet access.
Google Machine Learning Crash Course (opens a new tab)scikit-learn user guide (opens a new tab)Finish this lesson
Mark this lesson complete when you’re ready to continue.