Different results when using oobPredict for TreeBagger

조회 수: 5 (최근 30일)
Liviu Theodor Ene
Liviu Theodor Ene 2012년 8월 13일
I've noticed that averaging the predicted OOB responses for individual trees using 'oobPredict(B, 'trees', i)' produces different results than when using oobPredict(B, 'trees', 'all'). Ex:
b = TreeBagger(no_trees,xtrain,ytrain,'method','r','OOBVarImp','off',... 'OOBPred','on','minleaf',1); yhat_oob_tree = zeros(no_trees,numel(ytrain)); for i = 1:no_trees % one row per tree yhat_oob_tree(i,:) = oobPredict(b,'trees',i); end avg_yhat_oob_tree = mean(yhat_oob_tree); %avg. by observations(columns) yhat_oob_all = oobPredict(b);
That is, 'avg_yhat_oob_tree' and 'yhat_oob_all' are different, doen anyone why this happens?
Thank you!

답변 (1개)

Ilya
Ilya 2012년 8월 13일
See http://www.mathworks.com/matlabcentral/answers/9638-difference-between-individual-and-cumulative-oobmargin-of-treebagger It's the same problem here. When you ask for obbPredict from one tree, you get predictions filled with default values for in-bag observations.

카테고리

Help CenterFile Exchange에서 Classification Ensembles에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by