Specialty Digest

Global English editionLearners’ Study Dashboard — in development
The Knowledge Library for All

Accuracy

nounAI Evaluation and Reliabilityalso classification accuracy, prediction accuracy, accuracy score

In one line

In machine learning, accuracy is the proportion of a model's predictions that are correct, calculated as correct predictions divided by total predictions, and it is the simplest but often misleading measure of classification performance.

Accuracy in machine learning is the proportion of a model’s predictions that are correct. It is calculated by dividing the number of correct predictions by the total number of predictions, and is usually expressed as a percentage. A spam filter that classifies 970 of 1,000 emails correctly has an accuracy of 97 percent. Accuracy is the first metric most people meet, because it is simple and intuitive, but it can hide serious problems. It is one measure within model evaluation, and should be read together with precision, recall and the confusion matrix.

The formula

For a binary classifier, predictions fall into four groups: true positives (TP), true negatives (TN), false positives (FP) and false negatives (FN). Accuracy is

Accuracy = (TP + TN) / (TP + TN + FP + FN)

In words, it is the number of correct answers, both positive and negative, over all answers [1]. For problems with more than two classes, it is the number of correct predictions over the number of examples. The related error rate is one minus accuracy.

Example

A medical test is run on 1,000 patients. Of these, 100 have the condition and 900 do not. The test correctly identifies 80 of the sick patients (TP = 80, FN = 20) and correctly clears 810 of the healthy ones (TN = 810, FP = 90). Accuracy is (80 + 810) divided by 1,000, or 89 percent. The number looks respectable, but it says nothing about the fact that one in five sick patients was missed, which a recall of 80 percent reveals.

The accuracy paradox

Accuracy treats all errors alike and depends heavily on how common each class is. Suppose only one transaction in a thousand is fraudulent. A useless model that labels every transaction “legitimate” has an accuracy of 99.9 percent, yet catches no fraud at all. This effect, called the accuracy paradox, means that high accuracy is not proof of a good model, especially on imbalanced data [2]. The same trap appears in rare disease screening, defect detection, security alerts and many other real tasks.

When accuracy is appropriate

Accuracy is a reasonable summary when:

  • classes are roughly balanced,
  • all kinds of errors cost about the same, and
  • the test data reflects the real-world mix of cases.

Digit recognition on a balanced benchmark is one example. Even there, accuracy should be paired with an analysis of which classes are confused.

Better alternatives and companions

  • Precision. Of the cases flagged positive, how many are truly positive.
  • Recall. Of the truly positive cases, how many were found.
  • F1 score. Balances precision and recall in a single number; see F1 score.
  • Balanced accuracy. The average of recall across classes, which prevents a majority class from dominating [2].
  • Matthews correlation coefficient. A single balanced score that uses all four cells of the confusion matrix.
  • ROC AUC and precision-recall AUC. Summaries of performance across all decision thresholds [1].
  • Cost-sensitive measures. Weighted errors that reflect real costs, such as the harm of a missed diagnosis compared with a false alarm.
  • Top-k accuracy. For problems with many classes, such as image recognition with 1,000 categories, a prediction counts as correct if the right label is among the model’s top k guesses.

Accuracy in other contexts

  • Regression and forecasting. Accuracy is not defined in the same way for numeric predictions, where errors such as mean absolute error or percentage error are used.
  • Language models. For multiple-choice benchmarks, accuracy is the share of questions answered correctly; for open-ended output, it must be judged by other means; see AI benchmark.
  • Measurement science. In metrology, accuracy means closeness to the true value and is distinguished from precision, meaning repeatability. The machine learning term “precision” has a different meaning, which can confuse beginners.

Common mistakes

  • Reporting training accuracy. It overstates performance because the model has seen the data; evaluate on testing data.
  • Ignoring class balance. Check the share of the majority class as a baseline.
  • Comparing across data sets. Accuracy of 90 percent on an easy task and on a hard one mean different things.
  • Ignoring uncertainty. On a small test set, accuracy has wide confidence intervals.
  • Treating one number as the story. Analyze errors by subgroup and by type; see algorithmic bias.
  • Setting the threshold carelessly. Accuracy depends on the cutoff that turns a probability into a decision.

Improving accuracy

If accuracy is too low, causes can be traced with error analysis. Remedies include better or more training data, fixing label errors, richer features, a more suitable model, tuning with validation data, reducing overfitting or underfitting, and combining models in ensembles.

Accuracy and decision thresholds

Many classifiers output a probability, and a threshold, often 0.5, turns it into a yes or no. Moving the threshold changes the mix of errors and therefore the accuracy. Raising it makes the model more cautious, producing fewer false positives and more false negatives, while lowering it does the opposite. The threshold that maximizes accuracy is not necessarily the one that best serves the application. A cancer screening tool might use a low threshold to catch nearly every case and accept many false alarms, which lowers accuracy but protects patients, while a system that automatically blocks accounts might use a high threshold to avoid wrongly punishing innocent users. Plotting performance across thresholds, as ROC and precision-recall curves do, shows the whole trade-off instead of a single point.

Calibration: are the probabilities honest?

Accuracy says nothing about whether a model’s confidence is trustworthy. A model that is right 90 percent of the time but claims 99 percent certainty on every answer is poorly calibrated, which is dangerous when people or other systems rely on the stated confidence. Calibration is checked by grouping predictions by stated confidence and comparing each group’s average confidence with its actual hit rate. Methods such as temperature scaling can repair miscalibration after training. For high-stakes uses, both accuracy and calibration should be reported.

Human-level accuracy as a reference

Researchers often compare model accuracy with human accuracy on the same test. Human performance gives a sense of what is achievable and helps judge whether the remaining errors are due to the model or to ambiguous or mislabeled examples. When experts themselves disagree, there is a ceiling on measurable accuracy, because the reference labels contain noise. In such cases, reporting agreement between the model and each expert, instead of a single accuracy figure, is more honest; see data labeling.

FAQs

What is accuracy in machine learning? It is the share of a model’s predictions that are correct.

What is a good accuracy? It depends on the task and the baseline. On balanced data, 90 percent may be good, but on imbalanced data it can be meaningless.

What is the accuracy paradox? A model can have high accuracy yet be useless, because it simply predicts the majority class.

What is the difference between accuracy and precision? Accuracy measures overall correctness. Precision measures how many predicted positives are truly positive.

What should I use instead of accuracy? On imbalanced data, use precision, recall, F1, balanced accuracy or area under the curve.

More in AI Evaluation and Reliability

Key facts

  • Accuracy is defined as the number of correct predictions divided by the total number of predictions, equivalently the sum of true positives and true negatives over all cases1.
  • On imbalanced data a model can achieve very high accuracy by always predicting the majority class, a situation called the accuracy paradox2.
  • Balanced accuracy averages recall across classes, and is often a better summary when classes are unequal2.

Related concepts

Quick checkWhat is accuracy in machine learning?Show answer

Accuracy is the proportion of a model's predictions that are correct, calculated by dividing the number of correct predictions by the total number of predictions. It is simple to compute but can be misleading when classes are imbalanced.

Sources

  1. Tom Fawcett, An Introduction to ROC Analysis, Pattern Recognition Letters, https://doi.org/10.1016/j.patrec.2005.10.010
  2. Haibo He and Edwardo Garcia, Learning from Imbalanced Data, IEEE Transactions on Knowledge and Data Engineering, https://doi.org/10.1109/TKDE.2008.239

Editorially reviewed by Specialty Digest Editorial TeamLast reviewed November 17, 2026Researched and drafted with AI assistanceReport an issue