IA 360
Artificial Intelligence Glossary

Accuracy

Accuracy is the fraction of a classifier's correct predictions, but it misleads on imbalanced classes —hence it is paired with precision, recall, F1 and MCC.

Admin IA360 4 min read AI-generated Leer en español
Accuracy

Accuracy is the most intuitive metric for evaluating a classifier: it measures the fraction of predictions the model gets right out of the total. In a classification task you add up the hits —the true positives (TP) and true negatives (TN)— and divide by every prediction made. In plain text: Accuracy = (TP + TN) / (TP + TN + FP + FN), where FP are false positives and FN false negatives. The result, between 0 and 1 or given as a percentage, answers a simple question: what share of cases did the model label correctly?

How it is calculated

Every evaluation of a classifier starts from the confusion matrix, the table that cross-tabulates true labels against predicted ones and sorts each case into one of four cells: TP, TN, FP and FN. Accuracy collapses that table into a single number: the diagonal hits divided by the total. On a balanced binary problem —say, half legitimate emails and half spam— it is an honest, easy-to-communicate measure. In machine learning, «accuracy» carries the meaning above: the proportion of correct predictions.

Why it misleads with imbalanced classes

The trouble appears when one class dwarfs the other: a classifier that always chooses the majority class can achieve high accuracy while detecting none of the minority cases. The aggregate figure can hide that failure.

What to use instead

The metric should follow the cost of the error. F1 is the harmonic mean of precision and recall, but multiclass problems require the averaging rule—micro, macro or weighted—to be stated: they are not interchangeable. Balanced accuracy averages recall across classes and prevents the majority class's size alone from inflating the score. Conventional accuracy can accompany these measures; it cannot replace that choice.

This article was produced with artificial intelligence under human editorial oversight.

Share this article

This website uses cookies to improve the browsing experience. Cookie policy.

↑↓ navigate ↵ open esc close