Curves and Trees
Curves and Trees: Curves with Polynomial Features, Regression Trees.
Updated
- Curves with Polynomial Features (Journeyman): When the label rises and then falls, a straight line misses both ends, but adding a squared copy of a feature lets a linear regression draw a curve; PolynomialFeatures makes those columns, fit on the training rows and used to transform both parts, and a high degree swings wildly at the edges of the data.
- Regression Trees (Journeyman): A regression tree guesses a number by asking yes-or-no questions about the features and answering with the average label of the training rows that end in the same leaf, so its guesses are steps, never outside the range of the training labels, and a tree with no depth limit memorizes its training rows.