Data Science (Python) :: Decision Tree Regression

Sunil Kumar SV
2 min readJul 3, 2017

--

Intention of this post is to give a quick refresher (thus, it’s assumed that you are already familiar with the stuff) of Decision Tree Regression (using Python). You can treat this as FAQ’s as well.

What is CART?

CA - Classification Trees
RT - Regression Trees

*************************************************

What kind of linear regression is Decision Tree Regression?

Non-linear regression

*************************************************

What is the default criterion for Decision Tree Regression class?

Default criterion is MSE (Mean Square error). MSE = the square difference b/w the prediction and the real result and taking the sum of these differences to measure the error.

*************************************************

What kind of model is Decision Tree Regression model falls into?

Non-continuous model

*************************************************

Why do we need to plot with high resolution data set for visualizing Decision Tree Regression?

In Decision Tree Regression, the predicted values are obtained as per the average of that particular interval. Thus, without a high resolution, the plot would not show the actual representation of the fact that the prediction is based on averages in that particular interval.

*************************************************

Will Decision Tree Regression best suit for 1D models or 2D models?

Decision Tree Regression models are best suited for 2D models.

*************************************************

Sample code for implementing Decision Tree Regression?

from sklearn.tree import DecisionTreeRegressor
var_regressor = DecisionTreeRegressor(random_state = 0)
var_regressor.fit(var_X, var_y) #var_X & var_y are independent and dependent variable datasets respectively.

Next :- Data Science (Python) :: Random Forest Regression

Prev :- Data Science (Python) :: Support Vector Regression (SVR)

If you liked this article, please hit the ❤ icon below

--

--

Sunil Kumar SV

#ProductManager #TechEnthusiast #DataScienceEnthusiast #LoveToSolveProblemsUsingTech #Innovation