Accuracy
Accuracy is the share of a model's predictions that are correct, a simple and widely quoted measure of how well a classification model performs.
Accuracy is correct predictions divided by all predictions. Google's machine learning glossary gives the example of a model that makes 40 correct predictions out of 50, for an accuracy of 80%. In terms of a confusion matrix, it is true positives plus true negatives divided by everything. When a news story says a model scored 85% on a benchmark, it usually means the model answered 85% of the questions correctly, which is accuracy.
The number is easy to understand and easy to misread. Google's Machine Learning Crash Course shows why with an imbalanced dataset: when positives make up just 1% of cases, a model that always says negative scores 99% accuracy while catching none of the cases that matter. Fraud detection and disease screening both look like this, which is why they are judged mainly on precision, recall and the F1 score instead.
One fix is balanced accuracy, the average of the recall for each class. scikit-learn's documentation notes that for a classifier that only looks good because the test set is imbalanced, balanced accuracy falls to chance level, one divided by the number of classes. On a balanced dataset it equals ordinary accuracy.
Accuracy also means little without a point of comparison. On a four-option multiple-choice test, random guessing scores about 25%, so 40% is not impressive. It depends on the test set too: a model that is 95% accurate on a benchmark may do worse on the messier inputs of real use. Ask what the classes were, how balanced the test set was, and what simple baseline scored.
There is no universal figure. It depends on how balanced the data is, what a trivial model scores and what mistakes cost. On a dataset where 99% of cases are negative, 99% accuracy can mean the model learned nothing, while on a hard, balanced task 70% might be strong. Accuracy is the share of all predictions that were right. Precision only looks at the cases the model labelled positive and asks how many of those were really positive. A model can have high accuracy and poor precision when positives are rare. When one class is much more common, a model can score highly just by always predicting it. Google's course gives the case where positives are 1% of examples and always predicting negative gives 99% accuracy and 0% recall. Precision, recall, F1 and balanced accuracy expose this. Not quite. Accuracy in machine learning is a measurement: the share of correct answers on a defined test. Factual accuracy, or factuality, is about whether what a chatbot says is true. Benchmarks of factuality often report accuracy as their score.Common questions
What is a good accuracy score for a machine learning model?
What is the difference between accuracy and precision?
Why is accuracy misleading on imbalanced data?
Is accuracy the same as factual accuracy in chatbots?
Search for "accuracy vs precision vs recall", "balanced accuracy" or "accuracy paradox imbalanced data". Good sources are machine learning courses such as Google's Machine Learning Crash Course and the documentation of libraries like scikit-learn, which give exact formulas and worked examples. When a company reports an accuracy figure, look for the test set, the class balance and a baseline before taking the number at face value.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.