liveBook · Manning

Extrapolation

As explained in Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

Extrapolation is the estimation of values beyond the range of target values observed during training.

Extrapolation estimates target values beyond the range observed during training. It matters when future cases, especially time-series observations, may differ substantially from the past. Gradient boosting can extrapolate because it adds the outputs of a sequence of models, unlike random forests, whose regression predictions remain based on means of training subsamples. section 5.2.2

Choose an approach according to how far the prediction must extend:

  • Use gradient-boosted decision trees when moderate extrapolation is useful, including forecasting future values beyond the training targets. section 5.2.2
  • Prefer a linear model when inputs are far outside the training range or extreme outliers require stronger extrapolative behavior. section 5.2.2
  • Do not expect decision-tree regression or random-forest ensembles to predict target values above or below those seen during training. section 5.2.2

Gradient boosting regression

A regression variant removes classification logit and sigmoid transformations, initializes predictions with the mean target, then repeatedly fits trees to gradients and adds their weighted predictions. The resulting predictions can exceed the 0–1 range, demonstrating extrapolation beyond learned target limits. section 5.2.2

Listing 5.8 Plotting gradient boosting predicted probabilities
import matplotlib.pyplot as plt
 
proba = cls.predict_proba(Xt)                              #1
plt.figure(figsize=(8, 6))
plt.hist(proba, 
         bins=30,
         density=True,
         color='blue',
         alpha=0.7)                                        #2
plt.xlabel('Predicted Probabilities')
plt.ylabel('Density')
plt.title('Histogram of Predicted Probabilities')
plt.grid(True)
plt.show()

Plot predicted probabilities with a histogram to inspect their distribution before comparing regression behavior. section 5.2.2

How Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI covers it

How deep it goes
Explains additive gradient boosting and bounded tree predictions, then limits the discussion to moderate extrapolation and linear alternatives.
Examples
Uses a GradientBoostingRegression implementation and prediction histograms showing values beyond classification probability boundaries.
What it assumes
Assumes familiarity with gradient boosting, decision-tree regression, and linear regression while building the regression variant procedurally.
What you can do after
Evaluate whether gradient boosting or linear regression better suits predictions outside the training target range.
How it connects
Connects extrapolation with gradient boosting, decision trees, random forests, regression, linear models, and time-series prediction.

Also explained in

Compare how 3 books explain extrapolation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI. The section links point to the parts of the book it draws on.