Decision Tree Regression
Decision Tree Regression is a machine learning model that uses a decision tree for predictive analysis. Decision Tree builds regression models in the form of a tree structure. Decision trees are one of the simplest and most common ways of modelling outcomes based on decisions.
In machine learning, Decision Trees start by identifying the best feature for splitting the dataset which then finds the subsets that has the best possible value for the best feature. The dataset is split based on decisions until a level of optimization is reached.
For a deeper understanding of Decision Tree Regression, use the following resources:
In this practise session, we will learn to code Decision Tree Regression.
We will perform the following steps to build a simple Decision Tree Regressor using the Beer dataset from How To Choose The Perfect Beer Hackathon.
Step 1. Data Preprocessing
- Importing the libraries.
- Importing the data set.
- Dealing with categorical data.
- Classifying dependent and independent variables.
- Creating training and test sets.
Step 2. Decision Tree Regression
- Create a Decision Tree Regression
- Training the regressor with training data.
- predicting the salary for a test set.
- Calculating the score from Root Mean Log Squared Error.
Click on Start/Continue Hackathon to go to the practice page.