Want to build a decision tree when I have 4 categories in my dependent variable

I want to build a decision tree, but I have 4 categories (1,2,3,4) in my dependent variable. How can i build? I am familiar with the rpart package, which can be used for a binary dependent variable. I think that if we have more categories, we need to build a CHAID model. Please suggest.

data<-rpart(cluster, indvariable, data=segmentation, control=rpart.control(cp=0.01) 

The cluster is my dependent variable, which has 4 categories.

Thanks in advance.

+6
source share

Source: https://habr.com/ru/post/1014880/


All Articles