3
$\begingroup$

I'm trying to fit a decision tree over some data which has ~40K rows and ~200 features. The response variable, y, is ordinal and takes values {1,2,3} or {1,2,3,4} depending on the problem definition.

If I treat y as a categorical/factor variable, the response time for the training CART (using the rpart package) and testing (80/20 split) takes 20-30 seconds.

However, as soon as I try to use the rpartScore package in R and frame y as ordinal, the training doesn't complete even after close to 30-40 minutes.

I'm not very familiar with CART and the implementations here. I'm looking for hints to understand theoretically why this could be the case.

Resources for ordinal CARTs would be helpful. Especially an analysis of convergence-related issues.

$\endgroup$
  • $\begingroup$ Just wondering if this belongs on Stack Overflow. $\endgroup$ – Placidia Aug 13 '15 at 1:15
  • $\begingroup$ @Placidia I'm not sure what the logic is. :) I want to know theoretically if there are problems with convergence and things of the like. I can't get rpartScore to work but rpart works as expected. $\endgroup$ – Navneet Aug 13 '15 at 1:50
  • $\begingroup$ @Navneet why don't you simply stick to rpart, if it works? $\endgroup$ – Antoine Aug 19 '15 at 18:23
  • $\begingroup$ @Antoine I need to order the response classes. rpart is nominal as far as I know. Please correct me if I'm wrong. :) $\endgroup$ – Navneet Aug 19 '15 at 18:58
  • $\begingroup$ For that sort of question you ought to present the data and the syntax. So that people have a chance to try to reproduce your results/error. Otherwise how is it possible to test it all? $\endgroup$ – ttnphns Aug 20 '15 at 8:51
1
$\begingroup$

I tried it with a much smaller dataset and did indeed notice a small increase in time to completion. This is likely due to a different impurity function in rpartScore, although why it is taking that much longer is not entirely clear (particularly why absolute vs. squared differences in scores perform so differently).

Here's what you could do: 1. Try split = "quad", that seems to converge faster (default is "abs") 2. Try a subset of your data, this way you can at least see whether it does not run due to memory allocation problems or something else is going on. 3. Try to debug it, although the fact that it speeds up if you change the split argument seems to indicate pretty clearly that's where the problem is. 4. perhaps try random forests with new permutation-based variable importance measures

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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