I have a dataset with numerical and categorical variables and a binary output variable. I want to use the conditional importance in random Forest

This is my code

cont = cforest_unbiased(ntree=1000, mtry=1)
cf = cforest(asthma3~., data=xTrain, controls = cont)
conditional_importance = varimp(object = cf,conditional = T,
                                  threshold=threshold, nperm=1)#this is the line that is too slow

Even with small dataset like

> dim(x)
[1] 3058    7

The code take a lot of time. I have been waiting for the answer for more than 4 days. How can I speed up this computation? Am I doing anything wrong?

  • 1
    $\begingroup$ Do you mean other than reimplementing or parallelizing? The problem is that the "conditional importance" by itself in each tree is built around permutation tests and the splits also need to be found, so all that can take a while. Perhaps you could try to decrease the a) number of permutations in the node or b) the number of trees in the forest or c) decrease the mincriterion parameter (so the trees won't be so deep). But that may cost accuracy. Else, why not try another forest that is faster? $\endgroup$ – Momo Jan 5 '15 at 20:19
  • $\begingroup$ I have variables of with a different number of unique values and some of them are correlated. This makes the gini importance and the unbiased importance measure not reliable. I was wondering if a change in the size of the training set in each tree can change the time complexity or if there is any quicker alternative implementation. Also in other languages $\endgroup$ – Donbeo Jan 6 '15 at 1:15

Your Answer

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

Browse other questions tagged or ask your own question.