Um momento
0x30Lesson 4 of 6

Choose useful evaluation metrics

Match metrics to the cost of errors and the prediction task.

12 min 5-question quiz
By the end of this lesson you can
  • Compare classification and regression metrics and explain why accuracy can mislead.

Evaluation metrics summarize different aspects of model performance. For classification, precision measures how many predicted positives are correct, while recall measures how many actual positives were found. Accuracy can hide poor performance on a rare class. For regression, measures such as mean absolute error describe numeric prediction error. Choose metrics according to the costs of false positives, false negatives, and other mistakes.

A small example

Illustrative Python
1actual = [1, 1, 0, 0]
2predicted = [1, 0, 0, 0]
3correct = sum(a == p for a, p in zip(actual, predicted))
4print(f"Accuracy: {correct / len(actual):.2f}")
Output
Accuracy: 0.75

A metric does not decide whether a model is useful; it answers a particular measurement question. Inspect a confusion matrix, performance by relevant subgroup, and examples of errors. For changing or time-ordered data, use a split that reflects how predictions will be made instead of blindly shuffling observations.

Key takeaways

  • Compare classification and regression metrics and explain why accuracy can mislead.

  • Evaluate on relevant unseen data and monitor the system after deployment.

Lesson quiz

5 questions · pass with 4 correct · up to 50 XP

Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.

Questions about this lesson

Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.

Loading posts…

Gostou da aula? 😆👍
Apoie nosso trabalho com uma doação: