Regression Tree

noun

say it: “rih-GRESH-un TREE” /rɪˈɡrɛʃən ˈtri/

A model that predicts a number by asking a series of yes-or-no questions about the inputs and giving the average of the matching examples.

What is a regression tree?

A regression tree is a decision tree that guesses a number. It splits the examples with yes-or-no questions, such as "rain over 15 inches?", and each leaf guesses the average label of the training examples that ended up there, so its guesses come in steps. scikit-learn's is DecisionTreeRegressor.

from sklearn.tree import DecisionTreeRegressor
rain = [[10], [20], [30], [40], [50]]
apples = [100, 160, 180, 160, 100]
tree = DecisionTreeRegressor(max_depth=1).fit(rain, apples)
print(tree.predict([[12], [35]]))   # [100. 150.]: each leaf's average

In a sentence

  • “A regression tree can't guess higher than the highest harvest it learned from.”
  • “The regression tree gave every wet orchard the same guess: the average of the wet orchards it learned from.”

Level: Journeyman · More AI Basics terms at this level

Updated