I create a decision tree model with all categorical variables. Some of these categorical variables has over 100 possible values.
Here is my code:
model = rpart(score ~., data = dataset);
plot(model)
text(model)
The problem is that text(model)
annotates each split node with a long list of values for the corresponding categorical variable. And the values are squeezed into each other and hard to look at. I am looking for an option for text(model)
to display only the variable name and suppress all the values. That way at least the plotted tree is clear and shows which variable are used at each node.
Thanks in advance!
Leo