What accuracy measures
Accuracy is the most common single-number summary of how well a classifier performs. It answers a simple question: out of every prediction the model made, what fraction did it get right? In a binary classification problem, each prediction falls into one of four cells of a confusion matrix — true positive (TP), true negative (TN), false positive (FP), and false negative (FN). Accuracy adds up the two "correct" cells and divides by the total.
The formula
Accuracy = (TP + TN) / (TP + TN + FP + FN)
Equivalently, accuracy is simply the number of correct predictions divided by the total number of predictions. It is a pure ratio between 0 and 1, and is usually reported as a percentage by multiplying by 100. The error rate is its complement: error rate = 1 − accuracy = (FP + FN) / (TP + TN + FP + FN).
What the four cells mean
- True positive (TP): the actual label is positive and the model correctly predicted positive.
- True negative (TN): the actual label is negative and the model correctly predicted negative.
- False positive (FP): the actual label is negative but the model wrongly predicted positive (a "false alarm", or Type I error).
- False negative (FN): the actual label is positive but the model wrongly predicted negative (a "miss", or Type II error).
A worked example
Suppose a spam filter is evaluated on 200 emails: TP = 85, TN = 90, FP = 10, FN = 15. Correct predictions = 85 + 90 = 175, and the total = 200. Accuracy = 175 / 200 = 0.875 = 87.5%, so the error rate is 12.5%. The filter labelled 25 emails incorrectly (10 legitimate emails flagged as spam, and 15 spam emails let through).
Why accuracy alone can mislead
Accuracy weights every prediction equally, which is a problem when the classes are imbalanced. If 99% of transactions are legitimate and 1% are fraud, a model that predicts "legitimate" for everything reaches 99% accuracy while catching zero fraud. Whenever one class dominates, always report accuracy alongside precision (TP / (TP + FP)), recall (TP / (TP + FN)), and F1 score, or use balanced accuracy — the average of recall on each class.
Frequently Asked Questions
What is the formula for accuracy?
What is the difference between accuracy and precision?
Why is my accuracy high but the model still seems bad?
Can accuracy be used for more than two classes?
Common Tip Percentages
| Service | Typical Tip Range | Notes |
|---|---|---|
| Restaurant (sit-down) | 15–20% | 20%+ for exceptional service |
| Food delivery | 10–20% | Consider extra for long distances |
| Taxi / rideshare | 10–20% | More for assistance with luggage |
| Hotel housekeeping | $2–5/night | Leave daily, not just at checkout |
| Barber / hair salon | 15–20% | On pre-discount total |
| Pizza delivery | 10–15% or $3–5 minimum | Higher in bad weather |
General Household Budget Ratios (50/30/20 Rule)
| Category | % of Net Income | Examples |
|---|---|---|
| Needs | 50% | Rent, groceries, utilities, insurance |
| Wants | 30% | Dining out, entertainment, hobbies |
| Savings / Debt | 20% | Emergency fund, retirement, extra payments |
Common Measurement Conversions for Everyday Use
| Quantity | US / Imperial | Metric Equivalent |
|---|---|---|
| 1 cup | 8 fl oz | 237 mL |
| 1 pint | 16 fl oz | 473 mL |
| 1 quart | 32 fl oz | 946 mL |
| 1 gallon | 128 fl oz | 3.785 L |
| 1 lb | 16 oz | 453.6 g |
| 1 ft | 12 in | 30.48 cm |