La exactitud es una métrica de clasificación igual a la proporción de predicciones correctas entre todas las predicciones realizadas. Resulta útil en algunos entornos de evaluación, pero puede ser engañosa cuando las clases están desbalanceadas, donde la precisión, la exhaustividad u otras métricas pueden reflejar mejor el rendimiento del modelo.
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: Number | ---| 0 | 36499 | 0 | 25 | The accuracy of this model is therefore: Although 99.93% accuracy seems like a very impressive percentage, the model actually has no predictive power. Precision and recall are usually more useful metrics than accuracy for evaluating models trained on class-imbalanced datasets. See Classification: Accuracy, recall, precision and related metrics in Machine Learning Crash Course for more information.
A fraction of correct predictions in multiclass and binary classification. Accuracy measures the fraction of all labels that were correctly identified.
A side-by-side comparison of Accuracy and Precision. Understand why overall correctness can hide weak positive-class performance and why precision matters when false positives are costly.
A side-by-side comparison of Accuracy and Recall. Understand how overall correctness differs from the ability to find actual positive cases, especially when missed positives are costly.
A side-by-side comparison of Accuracy and F1 Score. Understand how overall correctness differs from a balanced measure of precision and recall.