I have a data set with 24 predictor variables, all continuous, but with different scales and potential collinearity. I’m trying to decide whether to use randomForest or cforest in party with conditional importance permutation.

I recognize that I should probably use cforest if I want to overcome variable selection bias, but I find the ability to get partial dependence plots and percent variance explained from the randomForest package to be quite appealing.

I was wondering if anyone knew if it were possible to get partial dependence plots and percent variance explained from cforest?

Also, it appears that ctree uses a significance test to select variables; is this the same for cforest? And how might I get these significance values for each variable in cforest?

  • 1
    $\begingroup$ ctree makes unbiased variable split selections. However, randomForest calculates two feature importance metrics. The mostly worthless one is based on split selections. The useful one is based on permutation tests. cforest is very slow and not worth it in my experience. I would just use randomForest and focus on permutation based importance measures. $\endgroup$ – Shea Parkes Sep 14 '12 at 19:52
  • $\begingroup$ The importance bias that cForest can potential address are when unequal factors are included in the predictor variables. If all of your data is continuous or you only have one factorial x variable just use RandomForest. The significance test in ctree are only relevant to single trees and are also available in rpart. You only get pseudo % variance in regression. If you have a regression problem I would highly recommend not using cForests. You can answer some of your own questions by reading the associated CART and Random Forests literature. $\endgroup$ – Jeffrey Evans Jan 10 '14 at 23:41
  • 2
    $\begingroup$ @JeffreyEvans Why not use party for regression? I thought party was supposed to help with correlated predictors – I may have missed an important detail in my recent scanning of the literature. $\endgroup$ – rbatt Apr 16 '14 at 2:49

my package edarf will calculate partial dependence for predictors using cforest. you can get permutation using the varimp function in the party package as well.

yes cforest generates an ensemble of trees of the same form as ctree with random features selected at each node and subsampling (by default). control the parameters of via cforest_control. if you download the source from the cran page you can see all the relevant code, most of which is written in C but is fairly readable.


You can now make partial dependence plots for any learner in R by using the mlr package. Here the tutorial package that explains how to do that: tutorial


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.