Different results when using oobPredict for TreeBagger
조회 수: 5 (최근 30일)
이전 댓글 표시
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!
댓글 수: 0
답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Classification Ensembles에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!