Decision Tree Regression (using DecisionTrees.jl)
Adapted from http://scikit-learn.org/stable/auto_examples/tree/plot_tree_regression.html
A 1D regression with decision tree.
The decision trees is used to fit a sine curve with addition noisy observation. As a result, it learns local linear regressions approximating the sine curve.
We can see that if the maximum depth of the tree (controlled by the max_depth parameter) is set too high, the decision trees learn too fine details of the training data and learn from the noise, i.e. they overfit.
1 | using DecisionTree |