Skip to content

まだ日本語ではご覧いただけません。 日本語で読めるものをすべて見る

Stockertim Dictionary · Technology

Test error

Also called out-of-sample error, generalisation error, test set error

In short

How badly a model fits data that was held back while it was built, which makes it the fairest guide to how the model is likely to do on new data.

  • Advanced
  • Concept
  • Checked

In detail

When a model is fitted, whether a regression for share returns or a machine-learning classifier, its parameters are tuned to the sample in front of it. Part of that tuning captures genuine patterns and part captures noise peculiar to the sample. To tell them apart, analysts split the data before fitting: a training set for building the model and a test set that stays sealed. Test error is the model's error on that sealed set, measured in exactly the same way as on the training data.

Comparing the two errors is the classic check for overfitting. As a model gains flexibility its training error keeps dropping, but its test error usually falls at first and then climbs once the model begins fitting noise. The point of lowest test error marks a sensible level of complexity. In finance, where signals are faint and prices noisy, the gap between in-sample and out-of-sample results is often wide.

A test set stays honest only if it is used sparingly. Trying many models against it and keeping the winner quietly turns it into training data. For time series, the test period should come after the training period, since shuffling dates lets the model learn from the future. Cross-validation and walk-forward testing stretch limited data further.

Worked example

A model of monthly returns has a mean squared error of 4 on its training years and 9 on the later years held back for testing.

  1. Gap between test and training error: 9 − 4 = 5
  2. Test error relative to training error: 9 / 4 = 2.25

The model does more than twice as badly on years it never saw, a typical sign of overfitting.

In practice

Quantitative fund teams, bank model-validation units and supervisors reviewing models all ask for out-of-sample results. A backtest that reports only how well a strategy fits the period it was designed on is treated with caution.

Watch out

  • Using the test set to choose among many models makes its error look better than it really is.
  • Random splits of time-series data leak future information into training.

Learn it properly

Official sources

Facts last checked on 4 November 2026.

Education, not advice: the Stockertim Dictionary explains what terms mean. It never recommends buying or selling anything.

English