- Precision and recall are evaluation metrics for classification models, built from true and false positives and negatives.
- Precision = True Positives / (True Positives + False Positives): of everything flagged positive, how much really is.
- Recall = True Positives / (True Positives + False Negatives): of all real positives, how many the model found.
- In a spam filter, a spam email marked as spam is a true positive; a missed spam email is a false negative.
What is Precision and Recall?
Precision and Recall are two evaluation metrics used to determine the effectiveness of a classification model. These metrics help to measure the quality of the model by looking at the number of true positives, true negatives, false positives, and false negatives.
Precision is the ability of a classification model to identify only the relevant data points. It is the fraction of the true positives predicted by the model out of all the true and false positives. For example, if a spam filter marks an email as spam and it is indeed spam, then this is counted as a true positive. Precision is calculated as:
Precision = True Positives / (True Positives + False Positives)
Recall, on the other hand, is the ability of a classification model to find all the relevant data points. It is the fraction of the true positives predicted by the model out of all the true positives and false negatives. For example, if a spam filter misses a spam email, then this is counted as a false negative. Recall is calculated as:
Recall = True Positives / (True Positives + False Negatives)
How do Precision and Recall work?
When a classification model is trained, it makes predictions based on the features of an input. These predictions can be either positive or negative, and the goal is to identify as many true positives and true negatives as possible. However, the model may also produce a certain number of false positives (i.e., incorrectly identifying a negative as a positive) and false negatives (i.e., incorrectly identifying a positive as a negative).
Precision and Recall measure the effectiveness of a classification model in identifying true positives while minimizing false positives (precision) and false negatives (recall).
Why is Precision and Recall Important?
Precision and Recall are important because they measure the accuracy of a classification model. High precision means that the model rarely labels a negative as positive, so it produces few false positives. High recall means that the model finds most of the actual positives in the dataset.
Businesses use precision and recall to evaluate the performance of their machine learning models and to optimize their models for specific applications. By using precision and recall, businesses can ensure that their models are making accurate predictions and minimizing errors.
Precision and Recall in H2O AI
H2O-3 and H2O Driverless AI report precision and recall, along with F1, for binary classification models, so you can choose the threshold that fits your use case. H2O-3 model performance metrics.