Precision, Recall and Accuracy for Classification models
The accuracy of a classification model is judged by whether the predicted class is the same as the actual class. Let us assume the levels of a class as either positive or negative, then -
- For all predicted positives, they can be either true (right) or false (wrong).
- For all predicted negatives, they can be either true (right) or false (wrong).
Precision is a ratio defined as (True Positives)/(Predicted Positives). Ideally 1.
Recall is a ratio defined as (True Positives)/(Actual Positives). It is also called Sensitivity or True Positive Rate (TPR). Ideally 1.
Specificity is a ratio defined as (True Negatives)/(Actual Negatives). It is also called Selectivity. Ideally 1.
Accuracy is a ratio defined as (True Positives + True Negatives)/(Total Predictions). Ideally 1.
Python Implementation: sklearn.metrics -> classification_report
Comments
Post a Comment