VerifiedEvidence: highv1.0.0

Overfitting

A situation in which a model is fit too closely to the noise in its training data, performing poorly on new, independent data.

Last reviewedDarrin Baines IP Ltd

Concept Architecture

Concept


Theoretically, Overfitting is a modelling phenomenon in which a statistical or machine learning model captures random variation and noise in the training data rather than the underlying data-generating process. An overfitted model achieves excellent performance on the data used for estimation but performs poorly when applied to new observations because it has insufficient generalisability. Overfitting exists as a consequence of excessive model complexity relative to the amount of available information and is fundamentally linked to the bias-variance trade-off.

Mathematically, overfitting is characterised by a reduction in training error accompanied by an increase in prediction error on independent data. It is commonly assessed by comparing model performance using validation datasets or cross-validation. Excessive model flexibility increases estimator variance, causing the expected prediction error to rise even though the apparent fit to the training data continues to improve.

In practice, overfitting is identified by evaluating predictive performance on independent validation datasets, using cross-validation, bootstrap validation or information criteria. In health economics, overfitting may occur when developing prediction models for healthcare costs, quality-adjusted life years, disease progression or resource utilisation using too many predictors or overly complex algorithms relative to the sample size. Prevention strategies include penalised regression, model simplification, regularisation and external validation.

Purpose


Used to assess whether statistical or machine learning models generalise beyond the training data, identify excessive model complexity and guide the development of robust predictive models in health economic research.


Mathematical Formulae

Primary Formula

Expected prediction error:

EPE = Bias� + Variance + ��

where:

  • Bias� = squared systematic error
  • Variance = variability of the fitted model
  • �� = irreducible error

Supporting Formulae

Mean Squared Error:

MSE = (1/n) ? ?(y? ? ??)�

Cross-validation error:

CV = (1/k) ? ????? L?

Akaike Information Criterion:

AIC = ?2ln(L) + 2p

Bayesian Information Criterion:

BIC = ?2ln(L) + p ln(n)

Related Mathematical Methods

  • Cross-Validation
  • Regularisation
  • Ridge Regression
  • Lasso Regression
  • Bias-Variance Trade-off
  • Model Validation
  • Bootstrap Validation

Example

A health economist develops two models to predict annual healthcare costs using 5,000 patient records.

Model A contains eight clinically justified predictors.

Model B contains 85 predictors, including numerous interaction terms.

Performance is assessed using ten-fold cross-validation.

ModelTraining MSEValidation MSE
A1.221.31
B0.762.48

Although Model B fits the training data substantially better, its much larger validation error indicates overfitting. Model A is therefore preferred because it is expected to perform more reliably when predicting healthcare costs for new patients.


Excel Implementation

FunctionExample FormulaHealth Economics Application
AVERAGE=AVERAGE(B2:B11)Calculate the mean cross-validation error across folds.
POWER=POWER(B2-C2,2)Calculate squared prediction errors.
SUMPRODUCT=SUMPRODUCT((Actual-Predicted)^2)/COUNT(Actual)Calculate Mean Squared Error for model validation.
MIN=MIN(B2:B20)Identify the model with the lowest validation error.
SolverOptimise model complexity while minimising validation error.Compare candidate prediction models and reduce overfitting.

VBA (Optional)

A VBA routine can automate cross-validation, compare training and validation errors across candidate models and identify models exhibiting evidence of overfitting.


Sources

  • Hastie T, Tibshirani R, Friedman J. The Elements of Statistical Learning. Springer.
  • James G, Witten D, Hastie T, Tibshirani R. An Introduction to Statistical Learning. Springer.
  • Bishop CM. Pattern Recognition and Machine Learning. Springer.
  • Harrell FE. Regression Modeling Strategies. Springer.
  • Briggs A, Claxton K, Sculpher M. Decision Modelling for Health Economic Evaluation. Oxford University Press.
  • ISPOR Good Practice Reports.

Library

Publications

1
  • Book

    Statistical Analysis of Cost-Effectiveness Data — Willan & Briggs, 1st Edition ed., 2006 (John Wiley & Sons)

    A synthesis of statistical methods for analysing cost-effectiveness data, including net-benefit regression, confidence intervals for the ICER, cost-effectiveness acceptability curves, and covariate adjustment. Part of the Wiley Statistics in Practice series.

Frequently Asked Questions (6)

  • What is overfitting?

    A situation in which a model is fit too closely to the noise in its training data, performing poorly on new, independent data.

    Source: Hastie, Tibshirani & Friedman 2009

  • What goes wrong when a model overfits its training data?

    Overfitting happens when a model is tuned so closely to the data used to build it that it captures their random noise as though it were real signal. Such a model looks excellent on its training data but performs poorly on new cases, because the quirks it learned do not carry over. It typically arises when a model is too complex for the amount of data, and it is guarded against by keeping models simple enough and by checking performance on held-out data. Mistaking noise for pattern is its failing. Hastie and colleagues (2009) describe this.

    Source: Hastie et al. 2009

  • Why does overfitting occur?

    Overfitting occurs when a model is too flexible or complex for the amount and structure of the data, so it fits the random noise in the training sample as if it were signal, or when it is trained too long or with too many predictors relative to the observations. So overfitting occurs from excessive model complexity relative to the data, which allows the model to capture chance features of the training sample that do not generalise, and this is why the risk of overfitting rises with more flexible models, more predictors, and smaller samples, making the control of complexity central to building models that generalise well.

    Source: Hastie, Tibshirani & Friedman 2009

  • How is overfitting detected?

    Overfitting is detected by comparing performance on the training data with performance on independent data: a model that does well in-sample but markedly worse out-of-sample, assessed through a held-out test set or cross-validation, is overfitted. So overfitting is detected through the gap between in-sample and out-of-sample performance, since an overfitted model appears accurate on its training data but fails to generalise, which is why out-of-sample evaluation is used to reveal overfitting, and a substantial drop in accuracy on new data signals that the model has captured noise rather than generalisable structure.

    Source: Stone 1974

  • How is overfitting prevented?

    Overfitting is prevented by controlling model complexity and validating properly: using regularisation to constrain flexibility, selecting an appropriate number of predictors, using enough data, and choosing model settings by cross-validation to favour models that generalise. So overfitting is prevented by matching model complexity to the data and using out-of-sample validation to guide model choice, which discourages fitting noise, and techniques such as regularisation, careful feature selection, and cross-validation all serve to build models that capture the underlying pattern without adapting excessively to the training sample, thereby improving their performance on new data.

    Source: Hastie, Tibshirani & Friedman 2009

  • How does overfitting relate to the bias-variance tradeoff?

    Overfitting relates to the bias-variance tradeoff as the high-variance extreme: an overfitted model has low bias but high variance, fitting the training data very closely, including its noise, so it varies greatly with the sample and generalises poorly. So overfitting corresponds to excessive variance in the bias-variance tradeoff, where increasing model flexibility reduces bias but raises variance until the model captures noise, which is why managing the tradeoff, by choosing a complexity that balances bias and variance, is the way to avoid overfitting, seeking a model flexible enough to capture the pattern but not so flexible that it fits the noise.

    Source: Hastie, Tibshirani & Friedman 2009

Trust Record

Verified by Dr Darrin Baines

British health economist

Professional identity: darrinbaines.org

Verification date: 22 Dec 2025

Content version: 1.0.0

Canonical Identity

Term code
HE-ES-SA-146

Stable URI · Machine-readable · Resolvable · CC BY 4.0