ZeroR
ZeroR is the simplest classifier: ignore every predictor and always predict the majority class. Useless alone, essential as a baseline benchmark.
4 min read · Updated August 8, 2026
ZeroR is the simplest classification method there is: it relies on the target alone and ignores all predictors. The ZeroR classifier simply predicts the majority class, every time, for every input.
ZeroR has no predictive power, but it is far from useless. It defines the baseline performance that every other classification method must beat — a model that cannot outperform “always guess the most frequent class” has learned nothing.
The ZeroR algorithm
Construct a frequency table for the target and select its most frequent value. Formally, if class occurs times in a training set of rows, ZeroR predicts
for every row, and its training accuracy is exactly the majority proportion .
Worked example: Play Golf
The 14-row Play Golf dataset records weather conditions and whether a round of golf was played:
| Outlook | Temp | Humidity | Windy | Play Golf |
|---|---|---|---|---|
| Rainy | Hot | High | False | No |
| Rainy | Hot | High | True | No |
| Overcast | Hot | High | False | Yes |
| Sunny | Mild | High | False | Yes |
| Sunny | Cool | Normal | False | Yes |
| Sunny | Cool | Normal | True | No |
| Overcast | Cool | Normal | True | Yes |
| Rainy | Mild | High | False | No |
| Rainy | Cool | Normal | False | Yes |
| Sunny | Mild | Normal | False | Yes |
| Rainy | Mild | Normal | True | Yes |
| Overcast | Mild | High | True | Yes |
| Overcast | Hot | Normal | False | Yes |
| Sunny | Mild | High | True | No |
The frequency table for the target is:
| Play Golf | Count |
|---|---|
| Yes | 9 |
| No | 5 |
Yes is the majority class, so the ZeroR model is simply “Play Golf = Yes” — regardless of Outlook, Temp, Humidity, or Windy. Its accuracy is the majority proportion:
Predictor contribution
There is nothing to say about predictor contribution, because ZeroR does not use any of them. That is precisely what makes it a clean benchmark: any contribution a fancier model extracts from the predictors shows up as accuracy above 0.64.
Model evaluation
The confusion matrix shows that ZeroR only ever predicts the majority class:
| Actual Yes | Actual No | ||
|---|---|---|---|
| Predicted Yes | 9 | 5 | PPV = 9/14 = 0.64 |
| Predicted No | 0 | 0 | NPV = 0.00 |
| Sensitivity = 1.00 | Specificity = 0.00 | Accuracy = 0.64 |
Sensitivity is a perfect 1.00 (every actual Yes is caught) while specificity is 0.00 (no actual No is ever identified) — the signature of a classifier that is not really classifying. See Model Evaluation — Classification for what these metrics mean.
In practice
scikit-learn ships ZeroR under the honest name sklearn.dummy.DummyClassifier with strategy="most_frequent". Fit it alongside every real model: on imbalanced problems it is the difference between a meaningful score and an embarrassing one — a fraud detector that always predicts “legitimate” can score 99% accuracy while being worse than useless. ZeroR also anchors OneR: the gap between the two is the value of a single predictor.
Common pitfalls
- Reporting accuracy without the baseline. On skewed data, a high accuracy can sit at or even below the ZeroR rate.
- Mistaking high sensitivity for skill. ZeroR gets perfect sensitivity by never predicting the minority class; read sensitivity and specificity together.
- Using ZeroR as a real model. It cannot rank predictors, produce useful probabilities, or adapt to any input.
- Forgetting that the baseline shifts with the data. Recompute it whenever the class distribution changes.
Summary
ZeroR predicts the majority class and ignores all predictors. On the Play Golf data it always predicts Yes and scores 9/14 ≈ 0.64. It has no predictive power, but as a baseline it is the first number you should compute in any classification project.