March 2019
Beginner to intermediate
464 pages
10h 57m
English
Now that we have encoded all of the categorical variables, we can finally start to build decision tree models. We are going to use these variables as features for our decision tree models: age, balance, campaign, previous, housing, job, and marital. In order to build and train a decision tree model with R, we are going to use the rpart package. You can import the required library by using the following line of code:
library(rpart)
If you do not have the rpart package installed, you can install it by using the following command:
install.packages("rpart")
Once you have imported the required library, you can use the following code to build a decision tree model:
fit <- rpart( conversion ~ age + balance + campaign + previous ...
Read now
Unlock full access