The decision tree regressor
When we have data that is non-linear in nature, a linear regression model might not be the best model to choose. In such situations, it makes sense to choose a model that can fully capture the non-linearity of such data. A decision tree regressor can be used to predict numeric outcomes, just like that of the linear regression model.
In the case of the decision tree regressor, we use the mean squared error, instead of the Gini metric, in order to determine how the tree is built. You will learn about the mean squared error in detail in Chapter 8, Performance Evaluation Methods. In a nutshell, the mean squared error is used to tell us about the prediction error rate.
Consider the tree shown in the following diagram: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access