Different results when using oobPredict for TreeBagger
15 次查看(过去 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!