Is there a direct way to visualize a c5.0 decision tree? Here my code:

library(C50)
data(churn)
myTree = C5.0(x = churnTrain[, -20], y = churnTrain$churn)
summary(myTree)

I am getting a long list of C5.0 objects from a program that I do not control but I could convert it into something else if that is absolutely necessary. Any ideas/pointers are highly appreciated.

closed as off-topic by Peter Flom Sep 11 '17 at 10:43

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question appears to be off-topic because EITHER it is not about statistics, machine learning, data analysis, data mining, or data visualization, OR it focuses on programming, debugging, or performing routine operations within a statistical computing platform. If the latter, you could try the support links we maintain." – Peter Flom
If this question can be reworded to fit the rules in the help center, please edit the question.

I might be missing something in your question but simply

plot(myTree)

gives you a visualization of the tree (based on the infrastructure in partykit)

C5.0 tree

Of course the tree is very large and you either need to zoom into the image or use a large screen to read it...

You can also use partykit to just display subtrees. For example if you want to just show the left branch below the root (starting from node 2) and the right branch below the root (starting from node 33) you could do:

library("partykit")
myTree2 <- C50:::as.party.C5.0(myTree)
plot(myTree2[2])
plot(myTree2[33])

Not the answer you're looking for? Browse other questions tagged or ask your own question.