7 Common Machine Learning Mistakes
One ice cream sales forecast, seven ways it can go wrong: from wrong labels to reading correlation as cause. Each mistake gets one sketch and one check.

On this page
A store trains a model to forecast its daily ice cream sales. The data says that on some days, nobody bought a single cone.
The store was closed on those days. The model does not know that. It learns that some days have zero demand.
Many machine learning mistakes look like this. The code runs and the scores look fine, but the model learns the wrong lesson. In this post, I follow the same ice cream forecast through seven of them: wrong labels, overfitting, no baseline, tuning on the test set, shuffling time data, training-serving skew and reading correlation as cause. Each section shows the mistake in one sketch and ends with one check you can run on your own model.
The order follows the life of a model: the data, the training, the evaluation, production, and acting on the results. All numbers in the sketches are illustrative.
1. Wrong labels
Are the answers in your data right?
A model learns from its labels, so wrong labels teach wrong lessons. Here, days when the store was closed are recorded as 0 sales, as if nobody wanted ice cream.

Two of the fourteen days are zeros because the store was closed, not because demand was zero.
This is not only a problem of small datasets. In Pervasive Label Errors in Test Sets Destabilize Machine Learning Benchmarks (opens in a new tab) (NeurIPS 2021), Northcutt, Athalye and Mueller estimate an average of at least 3.3% label errors in the test sets of 10 commonly used datasets.
2. Overfitting
Why does it fail on new days?
An overfit model memorizes noise in its training data. It scores well on that data and worse on new data. Here, a wiggly curve hits every past day and misses the new ones.

The zigzag fits every past day. The new days, drawn hollow, follow the straight line instead.
3. No baseline
Is the model better than a simple rule?
Before you trust a model, score a simple rule. Here, “same as last week” is off by 12 cones a day and the model by 11. Is one cone worth a model?

The model is only one cone a day better than the simple rule.
A model that wins by a small margin may still be worth it. The baseline tells you how small the margin is, so you can weigh it against the cost of building and running the model.
4. Test set tuning
Why did the score drop after launch?
Each time you check the test set and adjust, the model fits it a little more. Here, 50 tries raise the test score to 0.88, but new data gives 0.81.

The test score climbs with every adjustment. The score on new data does not.
5. Shuffled time data
Did the model see the future?
A random split mixes the days, so the model trains on days after the ones it is tested on. A real forecast never knows the future.

A random split scatters the test days. A split by time keeps them at the end.
scikit-learn has a splitter for this. With two weeks of daily data in date order, TimeSeriesSplit always tests on days after the training days:
import numpy as np
from sklearn.model_selection import TimeSeriesSplit
days = np.arange(14) # two weeks of daily sales, in date order
for train, test in TimeSeriesSplit(n_splits=3, test_size=2).split(days):
print("train", train.min(), "to", train.max(), "| test", test)train 0 to 7 | test [8 9]
train 0 to 9 | test [10 11]
train 0 to 11 | test [12 13]Each round trains on the past and tests on the next two days, as the forecast will work after launch.
6. Training-serving skew
Why does live data look different?
A feature is computed one way in training and another way in production. Here, training used the measured temperature, but at 8 a.m. only the forecast exists.

The feature has the same name in both places, but it means something different.
The sketch shows one cause, a different data source. Different code paths for the same feature cause the same problem. Google’s Rules of Machine Learning (opens in a new tab) suggest two habits against it: save the features used at serving time and train on that log (rule 29), and reuse code between the training and serving pipelines (rule 32).
7. Correlation as cause
Will more sunglasses sell more ice cream?
A model finds patterns, not causes. Ice cream and sunglasses sell together because sunny days drive both. Pushing one will not move the other.

Sunny days drive both sales. The link between the two boxes is a pattern, not a cause.
Seven questions
Before you ship a model, ask the seven checks as questions, in the same order.
Data and training
- Are the labels right?
- Is the gap between training and validation small?
- Does it beat a simple baseline?
Testing and use
- Was the test set used only once?
- Is the split by time?
- Are features built the same way live?
- Is it a pattern or a cause?
Try this today
Pick one model you built. Answer the seven questions for it, and fix the first “no”.
Which of these mistakes have you seen most often? I would like to read your answer in the comments, with the number and a short story.
How to cite
If you use this code or tutorial in your work, articles or publications, please cite it.
Mostapha Kalami Heris, 7 Common Machine Learning Mistakes (YPML302), Yarpiz, 2026. https://yarpiz.com/common-machine-learning-mistakes-ypml302@misc{yarpiz-ypml302,
author = {{Mostapha Kalami Heris}},
title = {{7 Common Machine Learning Mistakes}},
howpublished = {Yarpiz},
year = {2026},
note = {Code YPML302},
url = {https://yarpiz.com/common-machine-learning-mistakes-ypml302}
}Published
Comments