Decision Tree Regression: Avoiding Overfitting in Training Data

1 reply · 2K views · last reply
falyusuf
Messages
35
Reaction score
3
Homework Statement
Remove the overfitting in the following example.
Relevant Equations
-
The decision tree in the following curve is too fine details of the training data and learn from the noise, (overfitting).
Scatter plot of noisy data points with two step-function decision tree regression fits: a coarse max_depth=2 blue line and a jagged max_depth=5 green line tracking outliers.

Ref: https://scikit-learn.org/stable/aut...lr-auto-examples-tree-plot-tree-regression-py

I tried to remove the overfitting but not sure about the result, can someone confirm my answer? Here's what I got:
Scatter plot titled Decision Tree Regression of target against data from 0 to 5, with orange data points and two step-function fits: a coarse blue max_depth=2 line and a finer green max_depth=5 line that follows the point-level noise.
 
From your graph, it appears that you trained to 5 outliers at max=5, vs the 7 outliers in the original graph. What parameter did you adjust?