ajaiantilal / randomforest-matlab

Automatically exported from code.google.com/p/randomforest-matlab
6 stars 6 forks source link

How to get individual tree predictions for regression #65

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Is it possible to get the prediction per tree using regression, just as it is 
with classification?

This is possible:
[Y_hat, votes, prediction_pre_tree] = classRF_predict(X_tst,model,test_options);

But how can I make this work too?
[Y_hat, prediction_pre_tree] = regRF_predict(X_tst,model,test_options);

This would allow me to estimate the variance.

I know that it is possible in the c++ code, just not in the Matlab interface. I 
am not very skilled with c++ and compiling the mex codes; maybe someone has a 
compiled Mexfile with this feature?

Many thanks!

Original issue reported on code.google.com by woutervo...@gmail.com on 9 Sep 2014 at 8:14

GoogleCodeExporter commented 8 years ago
yup.

https://code.google.com/p/randomforest-matlab/source/browse/trunk/RF_Reg_C/regRF
_predict.m#12

see this example
https://code.google.com/p/randomforest-matlab/source/browse/trunk/RF_Reg_C/tutor
ial_RegRF.m#240

Original comment by abhirana on 10 Sep 2014 at 1:31

GoogleCodeExporter commented 8 years ago
Thanks, now it works! I was using the version from downloads rather than SVN...

Original comment by woutervo...@gmail.com on 10 Sep 2014 at 7:47