Anyone know the best packages to build a decision tree in Rstudio v3.3?

I want to look at some data-driven segmentation for my data. I was thinking of doing chaid analysis (mainly because this is why I've done in the past).

I've looked around myself, but can't find the best package for this version!


closed as primarily opinion-based by Stephen Rauch, timleathart, Toros91, Sean Owen Feb 12 '18 at 19:35

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Which packages have you looked at? What did you not like about them? $\endgroup$ – Elias Strehle Feb 12 '18 at 11:36

The "best" package depends on your goals and data really.

A few tree / forest packages that I've come across:

  1. randomForest - an implementation of the original algorithm
  2. ranger - a flexible implementation designed to run on high-dimensional data (my personal favourite forest package)
  3. party's ctree / cforest functions - conditional inference trees / forests
  4. rpart

Some of these packages focus on forests rather than trees; you can coerce the forest algorithm into building a tree by flexing appropriate parameters.


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