Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used cforest and randomForest for a 300 rows and 9 columns dataset and received good (almost overfitted - error equal to zero) results for randomForest and big prediction errors for cforest classifiers. What is the main difference between these two procedures?

I admit that for cforest I used any possible input parameters combination e.g. the best one, but still with big classification errors, was cforest_control(savesplitstats = TRUE, ntree=100, mtry=8, mincriterion=0, maxdepth=400, maxsurrogate = 1).

For very big datasets (about 10000 rows and 192 columns) randomForest and cforest have almost the same errors (the former slightly better on the same level as radial kernel svms), but for the mentioned small one for my surprise there is no way to improve cforest prediction accuracy...

share|improve this question
This is quite strange since those are implementation of the same algorithm... Are you sure you are not comparing OOB error estimation with error on train (this one is usually near 0 for RF, and this does not mean overfitting)? – mbq Feb 3 '11 at 22:44
RFs are generally not prone to overfitting issues... With default settings, 500 trees will be grown, considering $\sqrt{9}=3$ variables each time. As @mbq said, the cparty package relies on the randomForest package, but add some convenient way to assess "conditional importance". It's hard to tell anything without knowing how data are structured (No. classes, sample size/class, etc.). Of note, if you're trying all parameters combinations for your model without using a cross-validation scheme, then you're likely to break the control exerted by bagging etc. – chl Feb 3 '11 at 22:54
No, I compare both train errors and for RF it is usually equal to zero, but for cforest (party) it is much bigger and not expected... I know RF errors on additional test data are typically about 10-20%. – 42n4 Feb 3 '11 at 23:12
If so, I'm clueless... As @chl wrote, some code (or, ideally, a reproducible example) would be helpful. It may be also a bug/strange feature of party itself, so it can be a good idea to consult package maintainer. – mbq Feb 3 '11 at 23:53
@mbq I found that randomForest is based on CART trees and cforest - on unbiased conditional inference trees. – 42n4 Feb 4 '11 at 0:50

Could it be your value for the mtry parameter in cforest? With it set to 8, you're using bagging. Set it to mtry=3 and see how it compares to the randomForest algorithm

share|improve this answer
Welcome to CV, @manimal. There's certainly no problem with providing answers to old questions. In fact, if you can contribute something useful to the thread, we would prefer that you do. One note however, is that meta-comments on your answer are unnecessary & best left off. Since you're new here, you should read our about page & our FAQ, which contain info about the site & how to answer questions here. – gung Feb 20 '13 at 22:00

There are differences in implementations of randomForest and cforest, mainly in how predictions are computed from the forests. The differences are discussed in which provides a framework for comparing errors in survival forests.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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