.. _example_tree_plot_tree_regression.py: =================================================================== Decision Tree Regression =================================================================== 1D regression with :ref:`decision trees `: the decision tree 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 (controled 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. .. image:: images/plot_tree_regression_1.png :align: center **Python source code:** :download:`plot_tree_regression.py ` .. literalinclude:: plot_tree_regression.py :lines: 14-