Main Content

アンサンブル分類に学習をさせる

この例では、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: [100x1 double]
       FitInfoDescription: {2x1 cell}


MdlClassificationEnsemble モデルです。

アンサンブル内の 1 番目の学習済み分類木のグラフをプロットします。

view(Mdl.Trained{1}.CompactRegressionLearner,'Mode','graph');

Figure Regression tree viewer contains an axes object and other objects of type uimenu, uicontrol. The axes object contains 36 objects of type line, text. One or more of the lines displays its values using only markers

既定の設定では、fitcensemble はブースティング アルゴリズムの場合に浅い木を成長させます。木の深さは、木テンプレート オブジェクトを fitcensemble に渡すことにより変更できます。詳細は、templateTreeを参照してください。

平均的な予測子の測定値によりレーダー反射の品質を予測します。

label = predict(Mdl,mean(X))
label = 1x1 cell array
    {'g'}

参考

|

関連するトピック