Accuracy is an evaluation metric that measures the percentage of predictions a model gets correct.
Accuracy = Correct Predictions / Total Predictions
Example: Correct Predictions = 85, Total Predictions = 100 → Accuracy = 85%
Accuracy answers the question: out of all predictions, how many were correct?
Accuracy is useful because it gives a simple overall measure of model performance. It is easy to understand and easy to communicate.
A model has 90% accuracy — the model is correct 90 out of 100 times.
Accuracy can be helpful when all classes are balanced and all mistakes have similar importance.
The basic formula for accuracy divides the number of correct predictions by the total number of predictions.
Imagine a model predicts whether emails are spam or not spam.
The model correctly classified 80% of the emails.
A correct prediction means the model's prediction matches the true label. An incorrect prediction means the prediction does not match.
True Label: Spam
Prediction: Spam
Result: Correct
True Label: Spam
Prediction: Not Spam
Result: Incorrect
Binary classification has two possible classes. Accuracy counts all correct predictions across both classes.
Total Predictions = 200, Correct Predictions = 170 → Accuracy = 85%
Multi-class classification has more than two possible classes. Accuracy still counts how many predictions match the correct labels.
Total Images = 500, Correct Labels = 425 → Accuracy = 85%
A confusion matrix shows correct and incorrect predictions by category. For binary classification, accuracy uses all four parts.
Accuracy = (True Positives + True Negatives) / Total Predictions
A true positive happens when the model predicts positive and the true label is also positive.
A true negative happens when the model predicts negative and the true label is also negative.
A false positive happens when the model predicts positive, but the true label is negative.
A false negative happens when the model predicts negative, but the true label is positive.
Accuracy counts both correctly predicted positives and correctly predicted negatives.
Accuracy is most useful when the classes are balanced and different mistakes have similar costs.
Accuracy can be misleading when classes are imbalanced. In an imbalanced dataset, one class appears much more often than another.
The model has high accuracy but is not useful.
Class imbalance can hide poor performance on the smaller class.
Accuracy measures overall correctness. Precision measures how many predicted positives were actually positive.
Out of all predictions, how many were correct?
Out of all positive predictions, how many were actually positive?
Recall measures how many actual positives were found. It is important when missing positives is costly.
Out of all predictions, how many were correct?
Out of all actual positives, how many did the model catch?
If there are 100 fraud cases and the model finds 60, recall is 60%.
F1 score balances precision and recall. It is often useful when classes are imbalanced or when both false positives and false negatives matter.
Accuracy can be helpful in medical diagnosis, but it is not always enough.
In this case, recall may be more important because missing a disease can be dangerous.
Accuracy can be useful in spam detection, but false positives and false negatives still matter.
Accuracy should be considered with precision and recall.
Accuracy is often useful in image classification when classes are balanced.
A model may predict whether students pass or fail. If most students pass, accuracy can hide poor performance on students who need help.
Training accuracy measures accuracy on training data. Test accuracy measures accuracy on unseen test data.
A good pattern is when both training and test accuracy are strong and close together.
Poor accuracy patterns can suggest overfitting, underfitting, or weak model performance.
Accuracy on unseen data helps measure generalization — the model's ability to perform well on new examples.
High Training Accuracy + Low Test Accuracy
Model memorized training data.
Strong Test Accuracy
Better sign of real-world usefulness.
There are several ways to improve accuracy, depending on the problem and the model.
Accuracy is simple and useful, but it does not explain everything about model performance.
Accuracy is the percentage of correct predictions.
Formula: Accuracy = Correct Predictions / Total Predictions
A fraud detection model has 95% accuracy because it predicts every transaction as normal. The dataset contains 950 normal transactions and 50 fraud transactions.
Explain why the accuracy is high, why the model is still not useful, and which metric might help evaluate fraud detection better.
Ask the AI if you need help understanding accuracy, correct predictions, confusion matrices, class imbalance, precision, recall, or why accuracy alone is not always enough.