We have fit a logistic regression model for the German data. Now, we will create a decision tree for it.
Decision tree for german data
Getting ready
The GC2 object along with the partitioned data will be required here. Also, the fitted logistic regression model is needed.
How to do it ...
We will create the decision tree using the rpart package and its functionalities:
- Create the decision tree and plot it as follows:
GC_CT <- rpart (good_bad~., data= GC_Train)
windows ( height= 20 , width= 20 )
plot (GC_CT, uniform = TRUE ); text (GC_CT)
- The decision tree plot is...