Difference between individual and cumulative oobMargin of TreeBagger
5 ビュー (過去 30 日間)
古いコメントを表示
Why aren't the following two plots the same?
b = TreeBagger(500,X,Y,'oobpred','on');
mc = oobMargin(b,'mode','cumulative');
mi = oobMargin(b,'mode','individual');
figure; plot(mc.')
figure; plot(bsxfun(@rdivide,cumsum(mi.'),(1:500).'))
採用された回答
Ilya
2011 年 6 月 17 日
When you ask for an OOB margin from one tree, you get zero if this observation was in bag for this tree. The margin is undefined in this case, and TreeBagger returns 0 by default. The cumulative calculation averages over trees for which this observation was out of bag only. Check this out:
>> load fisheriris
>> b = TreeBagger(10,meas,species,'oobpred','on');
>> mi = oobMargin(b,'mode','individual');
>> mi(1,:)
ans = 1 0 0 0 1 0 1 1 0 0
>> b.OOBIndices(1,:)
ans = 1 0 0 0 1 0 1 1 0 0
>> mc = oobMargin(b,'mode','cumulative');
>> mc(1,:)
ans = 1 1 1 1 1 1 1 1 1 1
その他の回答 (1 件)
参考
カテゴリ
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!