Course Wiki
Precision and Recall — Machine Learning Zoomcamp Module 4
Precision tell us the fraction of positive predictions that are correct. It takes into account only the positive class (TP and FP - second column of the confusion matrix), as is stated in the following formula:
Related Pages
Machine Learning Zoomcamp › Module 4: Evaluation Metrics for Classification › Precision and Recall
Notes
Precision tell us the fraction of positive predictions that are correct. It takes into account only the positive class (TP and FP - second column of the confusion matrix), as is stated in the following formula:
\[P = \cfrac{TP}{TP + FP}\]Recall measures the fraction of correctly identified positive instances. It considers parts of the positive and negative classes (TP and FN - second row of confusion table). The formula of this metric is presented below:
\[R = \cfrac{TP}{TP + FN}\]In this problem, the precision and recall values were 67% and 54% respectively. So, these measures reflect some errors of our model that accuracy did not notice due to the class imbalance.
!classification_metrics.png
MNEMONICS:
-
Precision : From the
predicted positives, how many we predicted right. See how the wordprecision is similar to the wordprediction? -
Recall : From the
realpositives, how many we predicted right. See how the wordrecall is similar to the wordreal?
Add notes from the video (PRs are welcome)
| ⚠️ |
The notes are written by the community. If you see an error here, please create a PR with a fix. |
Key concepts
Related notes
- mlz-m02-car-price-prediction-project
- mlz-m02-computing-rmse-on-validation-data
- mlz-m02-feature-engineering
- mlz-m02-root-mean-squared-error-rmse
- mlz-m02-using-the-model
- mlz-m04-accuracy-and-dummy-model
- mlz-m04-confusion-table
- mlz-m04-cross-validation
- mlz-m04-evaluation-metrics-session-overview
- mlz-m04-explore-more
- mlz-m04-roc-auc
- mlz-m04-roc-curves
- mlz-m04-summary
- mlz-m06-decision-trees-parameter-tuning
- mlz-m06-selecting-the-best-model
- mlz-m06-xgboost-parameter-tuning