BitBootcampBitBootcamp ← all explainers 🔄 Review ⚙ Settings

AIM-01-007-P · Primer — The Baseline Model

The idea in one sentence

A baseline is the dumbest possible model — a single fixed rule that ignores the input — that you build first, so every clever model you train afterward has an honest number to beat.

Why it exists

A raw score is meaningless without a reference point. Ninety strokes on a golf course sounds great until you learn that par was seventy; "ninety-eight percent accurate" sounds like a triumph until you learn a coin-flip-simple rule already gets ninety-eight. The baseline is par: it tells you how hard the problem is before you spend a week on a neural network, and it converts a scary-looking number into one you can actually judge. Without it, you have no way to know whether your model learned anything or just got lucky on an easy distribution.

How it works

Before training anything, you build a model that never looks at the features and always emits the same prediction. For classification, that prediction is the majority class — whatever label is most common in the training set. For regression, it's the mean (or median) of the training targets. Worked example: in a fraud dataset of 1,000 transactions, 20 are fraud and 980 are clean, so 2% fraud. The majority-class baseline predicts "clean" every single time; it catches zero frauds yet is right on 980 of 1,000 rows — 98% accuracy. Now you train a neural network and it scores 97.5%. That looks high in isolation, but it lost to a model that does nothing, which means it has learned less than nothing useful.

See it — the baseline sets the bar your model must clear

flowchart TD
    A["1000 rows<br/>980 clean, 20 fraud"] --> B["Baseline:<br/>ignore input,<br/>always predict clean"]
    B --> C["Right on 980 / 1000<br/>= 98% accuracy"]
    C --> D{"Trained model<br/>beats 98%?"}
    D -->|"no, e.g. 97.5%"| E["No model<br/>learned nothing"]
    D -->|"yes, e.g. 99.2%"| F["Real signal<br/>keep it"]

The one gotcha

If you can't beat "always predict the majority," you have no model — you have an expensive way to recompute the majority. Beginners report a big accuracy number and celebrate; the baseline is what exposes that the number was never impressive. This is the same reason accuracy alone lies on imbalanced data: the baseline makes the lie obvious in a single line of code.

See it (visualization plan)

A CompareScene/TilesScene pairing: left tile the majority-class baseline at 98.0%, right tile the trained model at 97.5%, with a red banner "beat the baseline? NO." Precede it with a GridScene/TilesScene showing the 980-vs-20 class split so the viewer feels why "always clean" already scores 98. Close the mechanism on a ChainScene: ignore input → predict majority → 98% → your model must clear this bar.

The one-line takeaway

If you can't beat the majority, you have no model.

Where you'll meet it

In scikit-learn it's DummyClassifier (strategy="most_frequent" or "stratified") and DummyRegressor (strategy="mean") — two lines you run before anything else. For time series the analog is the persistence baseline ("predict yesterday's value"). Every Kaggle leaderboard, every honest experiment log, and every good model review starts with the same question: did it actually beat the baseline?

Named concepts: baseline model, majority-class baseline