AIExplainer
Machine Learning Intermediate

accuracy

The number of correct classification predictions divided by the total number of predictions.

The number of correct classification predictions divided by the total number of predictions. That is:

For example, a model that made 40 correct predictions and 10 incorrect predictions would have an accuracy of:

Binary classification provides specific names for the different categories of correct predictions and incorrect predictions. So, the accuracy formula for binary classification is as follows:

where: - TP is the number of true positives (correct predictions). - TN is the number of true negatives (correct predictions). - FP is the number of false positives (incorrect predictions). - FN is the number of false negatives (incorrect predictions). Compare and contrast accuracy with precision and recall.

Although a valuable metric for some situations, accuracy is highly misleading for others. Notably, accuracy is usually a poor metric for evaluating classification models that process class-imbalanced datasets. For example, suppose snow falls only 25 days per century in a certain subtropical city. Since days without snow (the negative class) vastly outnumber days with snow (the positive class), the snow dataset for this city is class-imbalanced. Imagine a binary classification model that is supposed to predict either snow or no snow each day but simply predicts "no snow" every day. This model is highly accurate but has no predictive power. The following table summarizes the results for a century of predictions: