Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

How to plot a proper decision tree using fancyrpartplot in R

$
0
0

@hackers wrote:

Hello,

I am trying to use decision trees for a multi-class classification problem as below:

#Use rpart:
model.rpart <- rpart(promotion_name ~ .,data = training_imp_var,method = "class")
model.rpart
rpart.plot(model.rpart)
#See cross validation results:
printcp(model.rpart)
#Prune the tree:
pruned.tree <- prune(model.rpart, cp = model.rpart$cptable[which.min(model.rpart$cptable[,"xerror"]),"CP"])
# Plot the tree						
fancyRpartPlot(pruned.tree)

which gives:

As can be seen nothing is properly visible in this.how do I make this plot more clear??
Can someone please help me with this??

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles