TreeBagger removes elements from the dataset during training process
3 次查看(过去 30 天)
显示 更早的评论
I am using the TreeBagger for classificate my data. I would like to extract some stats about it, like confusion matrix, but I can't due to a mismatch between the training sets.
%That's how I set the TreeBagger:
b = TreeBagger(50, X, y, 'method', 'classification', 'NVarToSample', 10, 'oobpred', 'on', 'MinLeaf', 10);
%output:
b =
Ensemble with 50 bagged decision trees:
Training X: [1801x32]
Training Y: [1801x1]
Method: classification
Nvars: 32
NVarToSample: 10
MinLeaf: 10
FBoot: 1
SampleWithReplacement: 1
ComputeOOBPrediction: 1
ComputeOOBVarImp: 0
Proximity: []
Prune: 0
MergeLeaves: 0
TreeArgs:
ClassNames: '-1' '1'
%Note: y was originally composed by 1834 elements
[y1, scores] = oobPredict(b);
[conf, order] = confusionmat(y, y1)
%ERROR: y1 is just 1801 elements long!
Why does it happens?
0 个评论
回答(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!