TreeBagger removes elements from the dataset during training process

3 ビュー (過去 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 Center および File ExchangeClassification Ensembles についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by