TreeBagger removes elements from the dataset during training process

조회 수: 2 (최근 30일)
Gianfranco
Gianfranco 2014년 7월 25일
편집: Gianfranco 2014년 7월 25일
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개)

카테고리

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