The trap
Accuracy feels simple. If your model gets 95% accuracy, it sounds internship-ready.
But accuracy only says the share of correct predictions. It does not say which mistakes the model made. In many hackathon datasets, one class is much more common than the other.
Remember this
High accuracy can be useless when the dataset is imbalanced. Always compare your accuracy with a dumb baseline that predicts the most common class.
A common case
Say you build a model to detect loan default risk. Your test set has 1,000 people. Only 50 actually default.
A model that predicts “no default” for everyone gets 950 correct answers. That is 95% accuracy. But it finds zero risky cases.
Total test rows: 1000
Actual defaults: 50
Actual non-defaults: 950
Model prediction: always "non-default"
Correct predictions: 950
Accuracy: 950 / 1000 = 95%
Useful for finding defaults: NoWhat beginners report
A beginner writes: “Our model achieved 95% accuracy.” That line hides the real failure.
A better line is: “The test set is imbalanced. A majority-class baseline gets 95% accuracy, so accuracy alone does not prove the model detects defaults.”
Check class balance
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 5 done
Quick Python check
Use this before you celebrate an accuracy score. It works for any label column in a CSV.
Change label to your target column name, like result, disease, churn, spam, or placed.
import pandas as pd
df = pd.read_csv("data.csv")
label_col = "label"
counts = df[label_col].value_counts()
total = len(df)
baseline_accuracy = counts.max() / total
print("Class counts:")
print(counts)
print("Majority-class baseline accuracy:", round(baseline_accuracy, 4))Use AI carefully
You can ask ChatGPT, Gemini, or Claude: “Given these class counts and model accuracy, explain if accuracy is misleading.”
Check that the answer compares your model to the majority-class baseline. If it only praises the accuracy number, it is not useful for evaluation.
Do this now
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 5 done