Fair Comparisons and Baselines
About 22 min
Goal
By the end of this lesson, you can explain what a baseline is, compare a predictor with a simple baseline on the same examples, and tell why a model score needs context before it can be called good.
Is 80% accuracy good?
Imagine someone says:
“My model is 80% accurate.”
That sounds impressive, but we are missing important information.
Suppose 80% of the examples belong to the same class. A strategy that always guesses that most common class might also get 80% accuracy without learning any useful pattern.
In that case, the model's 80% score is not an improvement over a very simple alternative.
This is why machine learning uses baselines.
A baseline is a simple reference strategy that gives us something meaningful to compare against.
A baseline answers “better than what?”
A model score by itself does not tell us whether the model is useful.
A baseline gives the score context.
Examples of simple baselines include:
- always predict the most common class;
- always predict the average number;
- use a simple hand-written rule;
- use the system that is already deployed today.
A baseline does not need to be clever. In fact, its value often comes from being simple and easy to understand.
If a complicated model cannot beat a simple baseline, that is important evidence.
A tiny majority baseline
Suppose our training examples are:
| Input | Label |
|---|---|
| 1 | False |
| 2 | False |
| 3 | False |
| 4 | True |
| 5 | True |
There are three False labels and two True labels.
The majority label is therefore False.
A majority baseline says:
ignore the input and always predict
False.
That sounds almost too simple to be useful, but that is exactly why it is a good reference.
Now evaluate both a threshold model and the baseline on the same held-out examples:
| Input | True label |
|---|---|
| 2 | False |
| 3 | False |
| 4 | True |
| 6 | True |
The threshold model uses threshold 4:
predict
Truewhen input >= 4
It gets all four held-out examples correct.
The majority baseline predicts False every time. It gets the first two correct but misses the last two.
So on this held-out set:
- threshold model: 0 mistakes;
- majority baseline: 2 mistakes.
Now the model's score has context. It did better than a simple alternative under the same evaluation.
Fair comparison means same test and same metric
Imagine a model is tested on easy examples and the baseline is tested on harder examples.
Even if the model gets a better score, we do not know whether the model is better or whether its test was easier.
For a fair comparison, keep the evaluation conditions aligned:
- same held-out examples;
- same labels;
- same metric;
- same rules for counting success.
The thing that should differ is the strategy being compared.