0
$\begingroup$

I'm using the rpart() to build a classification tree using R. I have no experience in this topic... Anyway, I started with the full model, and then I used the varImp() from "caret" to drop some variables and reduce my model. But when I plotted my final model, some variables does not appear on the tree (I just have 3/8 variables!). What does that mean? Any advice? I already have an accuracy of 63%, and I think is not so bad, but as I said, I have no experience with classification trees.

$\endgroup$
1
  • $\begingroup$ Although this refers to rpart, it's really about any tree implementation. $\endgroup$
    – Peter Flom
    Commented May 31, 2018 at 11:02

2 Answers 2

1
$\begingroup$

CART, the method implemented by rpart, looks for the best ways to split your data into groups. There is no requirement that it use all the variables you provide. It's entirely possible that some of your predictor variables just aren't very good predictors. If so, that's a worthwhile finding in itself. You can try running rpart with different parameters to make sure this finding is robust.

$\endgroup$
0
$\begingroup$

In addition to what @jaia said, there's no need to use Caret before Rpart (or any tree algorithm). The trees will find the important variables.

You might want to look for variables that are very highly related and use only one of any sets you find, to increase robustness.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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