1

I am doing a multi class classification of the data generated from a few group of subjects.

I have a dataset of 61 attributes and 4 groups. And I tried plotting decision tree for the same using the following code.

>dataset

>fit <- rpart(Group ~ a1 + a2 + a3 + a4 +..... + a61, data=dataset)
>plot(fit)

>text(fit, use.n = TRUE)

Where a1, a2 and a3 ..... a61 are the attributes of the dataset.

The tree plotted is very huge and doesnot fit in the desktop.. Could anyone help to visualize the tree? Or is there any other alternative method to prune the tree?

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194

1 Answers1

0

You can use the rpart.plot package. Check out this blog post.

However, you should consider pruning the tree: you'll get an easier to interpret (and to plot) model.

Community
  • 1
  • 1
Santiago Cepas
  • 4,044
  • 2
  • 25
  • 31