1
$\begingroup$

I've implemented random forest with both R random forest package and Weka java api. both with same data set (train and test sets are the same) and same configuration (number of trees and mtry). However, the results are different: R - 88.96% (1338 from 1504) accuracy, Weka - 69.28% (1042 from 1504) any suggestion what could make the differences?

$\endgroup$
  • 1
    $\begingroup$ Could you post some code please ? $\endgroup$ – RUser4512 Sep 13 '15 at 11:34
2
$\begingroup$

Random forests do have a lot of parameters... Are you using the default parameters, or did you set yours ?

My first guess is that you are using default parameters, therefore you have 10 trees in your Weka RF, whereas you have 500 trees with R. This would explain the huge difference in accuracy, in favor of R.

But there can be a lot of other differences as well! The seed may be a problem as well (though the impact will not even compare to the impact of the number of trees), mtry, split criterion, max_depth are to be considered with special care as well.

$\endgroup$
  • $\begingroup$ As I wrote, the number of trees and the mtry are equal between R and Weka (I set them manually, even the seed is the same). I didn't check for the split criterion and the max_depth - can it makes this kind of different? any other suggestions? $\endgroup$ – Adir Cohen Sep 11 '15 at 18:12
  • 1
    $\begingroup$ Usually, there is a slight difference between using entropy and fini $\endgroup$ – RUser4512 Sep 11 '15 at 21:02

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.