Definition
Overfitting happens when a model learns not only the real relationships but also the random noise of the training data — it looks great on them and fails on new data. It is typical of complex models (deep trees, large networks, regression with many predictors) and small datasets. It shows up as a gap between training and test error.
Data mining & machine learning
Defences: more data, a simpler model, regularization (penalizing complexity), tree pruning, early stopping of network training, variable selection and above all honest validation on data the model never saw during training. The opposite is underfitting — a model too simple to capture the relationship.
Overfitting threatens classical statistics too: a regression with 20 predictors on 30 observations has a high R² but zero explanatory value. As a rule of thumb you need at least 10–20 observations per estimated parameter.
In Statistica
Against overfitting Statistica offers test sets and v-fold cross-validation in all data-mining modules, tree pruning by validated error, automatic stopping of boosting and networks by test error, and stepwise selection or information criteria in regression; the Workspace environment shows training and test error side by side.
Related terms
- Cross-validationCross-validation estimates how well a model will perform on new data.
- Decision treesA decision tree splits data by a sequence of simple rules ("age > 45 and income < 30 thousand") into ever more…
- Neural networksAn artificial neural network is a model built from layers of connected "neurons" that learns from data to approximate…
- Linear regressionLinear regression describes how a dependent variable (yield, price, consumption) depends on one or more explanatory…
Knowledgebase guides
FAQ
- How do I recognize overfitting?
- Training error is markedly lower than test (or cross-validated) error. The bigger the gap, the worse the generalization.
- Is a high R² a sign of a good model?
- Not necessarily — with enough predictors you reach a high R² even on random data. Adjusted R² and error on new data decide.
Try it on your own data
Statistica free for 30 days
Full version, no credit card. Or get a pricing estimate in a minute.
Data mining & machine learning
Updated: September 2026.