Machine Learning Baselines: The Simple Prediction Your Model Must Beat
You train your first classifier. It hits 85% accuracy on the test set. You feel great—until you realize that a rule which ignores your data entirely would…

Key topics
You train your first classifier. It hits 85% accuracy on the test set. You feel great—until you realize that a rule which ignores your data entirely would have scored 90%.
That moment is the beginner's trap. I have watched learners celebrate scores that a naive predictor beats without breaking a sweat. The fix is not more complex models. The fix is one discipline: build the baseline before you trust any number.
Why a Score Means Nothing Until You Have Something to Beat
Here is the uncomfortable truth about machine learning scores: a raw number has no meaning in isolation. 85% accuracy sounds impressive until you learn that the data contains 85% of one class. A mean squared error of 1,000 sounds terrible until you learn that the thing you are predicting varies by tens of thousands.
A model score is only meaningful relative to a reference point. That reference point is your machine learning baseline: the simplest reasonable prediction that ignores most or all of your input data.
The core rule I want you to internalize: complexity must earn its place. Your fancy model does not deserve credit for being sophisticated. It deserves credit only for beating the dumbest reasonable guess on the same evaluation design.
If you have already worked with train/test splits and evaluation metrics, you have the tools to measure performance. The baseline is the missing reference point those tools compare against. Without it, you are driving without a speedometer—you know you are moving, but you have no idea whether the speed is appropriate.
Knowledge check
Check your understanding
Answer this question before you continue.
Two Kinds of Reference Points: Naive Baselines and Simple Benchmarks
Beginners often hear "baseline" and assume it means one thing. In practice, you will use two different reference points, and each has a distinct job.
The naive baseline is the floor. It ignores your input features entirely and predicts the same answer every time. It answers one question: what does "doing nothing" already achieve?
For classification, the classic naive baseline predicts the most frequent class—the mode. If 70% of your emails are legitimate, the baseline predicts "legitimate" for every single email and gets 70% accuracy without looking at a single word.
For regression, the classic naive baseline predicts the mean or median of the target. If you are predicting house prices and the average price in your training data is $350,000, the baseline predicts $350,000 for every house, no matter its size, location, or condition.
The simple model benchmark is the next rung up. It uses your features but stays deliberately simple: linear regression for regression problems, logistic regression for classification. It answers a different question: what can a minimal real model learn from this data?
Why keep these separate? Because they protect you from different mistakes. The naive baseline tells you whether your features carry any signal worth pursuing. The simple model benchmark tells you whether a more complex algorithm—a random forest, a gradient-boosted tree—adds value beyond a basic linear relationship. If your random forest barely beats linear regression, the extra complexity may not be earning its keep.
My recommended order: establish the naive floor first, then add a simple model benchmark when you start comparing against nonlinear models. The naive baseline is non-negotiable. The simple benchmark is your next checkpoint.
Knowledge check
Check your understanding
Answer this question before you continue.
The Imbalanced-Data Trap: Why Accuracy Can Lie
Let me show you why baselines matter with a concrete failure mode.
Imagine a dataset where 95% of rows belong to one class—say, a fraud detection problem where 95% of transactions are legitimate and 5% are fraudulent. You train a model and it scores 95% accuracy. You feel proud.
But a baseline that predicts "legitimate" for every transaction also scores 95% accuracy. It learned nothing. It looked at no features. It just guessed the majority class every time, and the data rewarded it.
This is why the baseline matters: it reveals what "doing nothing" already achieves. Your 95% accuracy suddenly looks less like a triumph and more like a starting point.
The baseline turns a confusing score into a diagnostic. If your model barely beats the majority-class guess, your features are not yet carrying signal. The problem is not your algorithm—it is your data, your features, or your metric. As you may have seen when choosing evaluation metrics, accuracy is often the wrong headline metric, especially with imbalanced classes. The baseline makes that visible in a way abstract advice never does.
Knowledge check
Check your understanding
Answer this question before you continue.
Building a Baseline in scikit-learn
Scikit-learn ships exactly the tools you need for this job: DummyClassifier and DummyRegressor. They are built for the sole purpose of creating naive predictors.
For classification, DummyClassifier with strategy='most_frequent' predicts the majority class. With strategy='stratified', it makes random predictions that preserve the class proportions it saw during training—so if 70% of training rows were class A, roughly 70% of its predictions will be class A. That makes it a slightly more informative baseline than always guessing the same class.
For regression, DummyRegressor with strategy='mean' or strategy='median' predicts a constant value.
The workflow looks like this:
- Split your data into training and test sets.
- Train a
DummyClassifierorDummyRegressoron the training data. - Evaluate it on the test set using the same metric you plan to use for your real model.
- Train your actual model.
- Evaluate it on the same test set with the same metric.
- Compare.
The key discipline: evaluate the baseline with the exact same split and the exact same metric you use for your real model. The comparison is only fair when the evaluation design is identical. If your baseline is evaluated on one split and your model on another, you are comparing apples to oranges.
One practical detail: if your baseline involves any randomness—like the stratified strategy—set a random seed so your results are reproducible. A baseline that changes every run cannot serve as a reliable measuring stick.
Knowledge check
Check your understanding
Answer this question before you continue.
Reading the Gap: What Your Baseline Tells You
Once you have both numbers, the gap between baseline and model performance becomes your diagnostic tool. But read it as a prompt for investigation, not a final verdict.
Small gap. Your features and model add little beyond a naive guess. This is not a failure—it is information. Investigate your data quality, engineer better features, or ask whether the problem is learnable at all with the data you have. Sometimes the honest answer is that the signal is not there yet.
Large gap. Your model is genuinely learning structure from your features. But before you celebrate, check that it is not just memorizing the training data. A large gap on the training set that shrinks on the test set is the classic signature of overfitting—a topic you will explore further with validation techniques.
Model worse than baseline. This is a red flag worth investigating, not just a disappointment. It can mean something is wrong: a bug in your preprocessing, a leak in your data, or a metric that does not match your problem. But it can also happen when a model is simply a poor match for the data, or when the evaluation metric hides useful behavior. Treat it as a clue, not a conviction.
Here is the honest version of what a gap proves: a positive gap is evidence that your model adds predictive value beyond a naive guess. It is not proof that your model will generalize reliably to new data. That proof comes from a sound validation design—the same held-out rows, the same split strategy, the same metric, and preprocessing that never touches the test set before the final evaluation.
One more distinction worth making: a constant dummy baseline does not use features, so it does not need scaling or feature transformations. A feature-using model does, and those transformations must be fitted on training data only. "Same preprocessing" means leakage-safe preprocessing, not identical inputs between a model that ignores X and one that consumes it.
The gap is not a one-time measurement. It is a diagnostic tool across your whole workflow. When you engineer new features, the baseline tells you whether those features are paying off. When you tune hyperparameters, the baseline tells you whether the tuning is justified. When you reach for a fancier algorithm, the baseline tells you whether the complexity earned its place.
Return to the baseline every time you add complexity. It is the anchor that keeps your evaluation honest.
Common Baseline Mistakes Beginners Make
Let me save you the trouble of learning these the hard way.
Comparing on different splits or metrics. The comparison is only fair when the evaluation design is identical. Same held-out rows, same split strategy, same metric, same leakage-safe preprocessing. Change any of these and you are no longer comparing models—you are comparing evaluation setups.
Letting the baseline peek at the test set. Your baseline should be trained only on training data. If you tune your baseline on validation data or let it see the test set, it stops being a naive reference and becomes another tuned model.
Skipping the baseline entirely. Judging a model by an absolute score is how beginners fool themselves. The baseline is not optional polish—it is the reference point that makes any score interpretable.
Forgetting the random seed. If your baseline involves randomness, set a seed. Reproducible experiments are the foundation of trustworthy evaluation.
Treating the baseline as a one-time step. The baseline is not something you build once and forget. It is a reference you return to as you add features, try new algorithms, and tune hyperparameters. Each time, ask the same question: did the added complexity beat the naive guess?
The Decision Rule
Before you celebrate any model score, do this:
- Build the naive baseline.
- Evaluate it with the same split and the same metric as your real model.
- Ask whether the gap justifies the complexity.
If the gap is small, your features are not carrying signal yet. If the gap is large, your model is learning something real—but verify it is generalizing and not memorizing.
The baseline is not the enemy of ambition. It is the floor that makes ambition measurable. When you move on to cross-validation and hyperparameter tuning, the baseline continues to serve as your reference point for judging whether added complexity is paying off.
Build the baseline first. Trust your scores after.
Knowledge check
Final check
Finish the article by checking the ideas you just learned.
References
Research updated Sep 8, 2026


