アンサンブル分類に学習をさせる
この例では、ionosphere データ セットについて分類木アンサンブルを作成し、このアンサンブルを使用して平均的な測定値をもつレーダー反射の分類を予測する方法を示します。
ionosphere データ セットを読み込みます。
load ionosphereアンサンブル分類に学習をさせます。バイナリ分類問題の場合、fitcensemble は LogitBoost を使用して 100 本の分類木を集約します。
Mdl = fitcensemble(X,Y)
Mdl =
ClassificationEnsemble
ResponseName: 'Y'
CategoricalPredictors: []
ClassNames: {'b' 'g'}
ScoreTransform: 'none'
NumObservations: 351
NumTrained: 100
Method: 'LogitBoost'
LearnerNames: {'Tree'}
ReasonForTermination: 'Terminated normally after completing the requested number of training cycles.'
FitInfo: [100×1 double]
FitInfoDescription: {2×1 cell}
Properties, Methods
Mdl は ClassificationEnsemble モデルです。
アンサンブル内の 1 番目の学習済み分類木のグラフをプロットします。
view(Mdl.Trained{1}.CompactRegressionLearner,'Mode','graph');
既定の設定では、fitcensemble はブースティング アルゴリズムの場合に浅い木を成長させます。木の深さは、木テンプレート オブジェクトを fitcensemble に渡すことにより変更できます。詳細は、templateTreeを参照してください。
平均的な予測子の測定値によりレーダー反射の品質を予測します。
label = predict(Mdl,mean(X))
label = 1×1 cell array
{'g'}