Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

hyperparameters

近似関数を最適化するための変数の説明

説明

VariableDescriptions = hyperparameters(FitFcnName,predictors,response) は、与えられた近似関数に対する既定の変数を返します。これらは、名前と値の引数 OptimizeHyperparameters'auto' に設定した場合に適用される変数です。

VariableDescriptions = hyperparameters(FitFcnName,predictors,response,LearnerType) は、指定された学習器のタイプによるアンサンブル近似の変数を返します。この構文は、FitFcnName'fitcecoc''fitcensemble' または 'fitrensemble' である場合に適用されます。

すべて折りたたむ

fitcsvm 分類器の既定のハイパーパラメーターを取得します。

ionosphere データを読み込みます。

load ionosphere

ハイパーパラメーターを取得します。

VariableDescriptions = hyperparameters('fitcsvm',X,Y);

すべてのハイパーパラメーターを確認します。

for ii = 1:length(VariableDescriptions)
    disp(ii),disp(VariableDescriptions(ii))
end
     1

  optimizableVariable with properties:

         Name: 'BoxConstraint'
        Range: [1.0000e-03 1000]
         Type: 'real'
    Transform: 'log'
     Optimize: 1

     2

  optimizableVariable with properties:

         Name: 'KernelScale'
        Range: [1.0000e-03 1000]
         Type: 'real'
    Transform: 'log'
     Optimize: 1

     3

  optimizableVariable with properties:

         Name: 'KernelFunction'
        Range: {'gaussian'  'linear'  'polynomial'}
         Type: 'categorical'
    Transform: 'none'
     Optimize: 0

     4

  optimizableVariable with properties:

         Name: 'PolynomialOrder'
        Range: [2 4]
         Type: 'integer'
    Transform: 'none'
     Optimize: 0

     5

  optimizableVariable with properties:

         Name: 'Standardize'
        Range: {'true'  'false'}
         Type: 'categorical'
    Transform: 'none'
     Optimize: 1

範囲が広がり、最適化で使用されるように、ハイパーパラメーター PolynomialOrder を変更します。

VariableDescriptions(4).Range = [2,5];
VariableDescriptions(4).Optimize = true;
disp(VariableDescriptions(4))
  optimizableVariable with properties:

         Name: 'PolynomialOrder'
        Range: [2 5]
         Type: 'integer'
    Transform: 'none'
     Optimize: 1

アンサンブル回帰関数 fitrensemble の既定のハイパーパラメーターを取得します。

carsmall データを読み込みます。

load carsmall

予測子変数として HorsepowerWeight を、応答変数として MPG を使用します。

X = [Horsepower Weight];
Y = MPG;

Tree 学習器の既定のハイパーパラメーターを取得します。

VariableDescriptions = hyperparameters('fitrensemble',X,Y,'Tree');

すべてのハイパーパラメーターを確認します。

for ii = 1:length(VariableDescriptions)
    disp(ii),disp(VariableDescriptions(ii))
end
     1

  optimizableVariable with properties:

         Name: 'Method'
        Range: {'Bag'  'LSBoost'}
         Type: 'categorical'
    Transform: 'none'
     Optimize: 1

     2

  optimizableVariable with properties:

         Name: 'NumLearningCycles'
        Range: [10 500]
         Type: 'integer'
    Transform: 'log'
     Optimize: 1

     3

  optimizableVariable with properties:

         Name: 'LearnRate'
        Range: [1.0000e-03 1]
         Type: 'real'
    Transform: 'log'
     Optimize: 1

     4

  optimizableVariable with properties:

         Name: 'MinLeafSize'
        Range: [1 50]
         Type: 'integer'
    Transform: 'log'
     Optimize: 1

     5

  optimizableVariable with properties:

         Name: 'MaxNumSplits'
        Range: [1 99]
         Type: 'integer'
    Transform: 'log'
     Optimize: 0

     6

  optimizableVariable with properties:

         Name: 'NumVariablesToSample'
        Range: [1 2]
         Type: 'integer'
    Transform: 'none'
     Optimize: 0

範囲が広がり、最適化で使用されるように、ハイパーパラメーター MaxNumSplits を変更します。

VariableDescriptions(5).Range = [1,200];
VariableDescriptions(5).Optimize = true;
disp(VariableDescriptions(5))
  optimizableVariable with properties:

         Name: 'MaxNumSplits'
        Range: [1 200]
         Type: 'integer'
    Transform: 'log'
     Optimize: 1

入力引数

すべて折りたたむ

近似関数の名前。リストされている分類近似関数名または回帰近似関数名のいずれかを指定します。

FitFcnName'fitcecoc''fitcensemble' または 'fitrensemble' である場合、引数 LearnerType で学習器のタイプも指定する必要があります。

例: 'fitctree'

予測子データ。予測子の列が D 列ある行列または table を指定します。D は予測子の個数です。

例: X

データ型: double | logical | char | string | table | cell | categorical | datetime

クラス ラベルまたは数値応答。グループ化変数 (グループ化変数を参照) またはスカラーを指定します。

例: Y

データ型: single | double | logical | char | string | cell

アンサンブル当てはめの学習器のタイプ。'Discriminant''Kernel''KNN''Linear''SVM''Tree'、またはこれらの学習器のテンプレートのいずれかを指定します。この引数は、FitFcnName'fitcecoc''fitcensemble' または 'fitrensemble' である場合に使用します。

'fitcensemble' の場合、'Discriminant''KNN''Tree'、または関連するテンプレートのみを指定できます。

'fitrensemble' の場合、'Tree'、または関連するテンプレートのみを指定できます。

例: 'Tree'

出力引数

すべて折りたたむ

変数の説明。optimizableVariable オブジェクトのベクトルとして返されます。変数には、範囲や変数の型など、既定のパラメーター セットがあります。使用可能な変数はすべて説明に含まれますが、'auto' の設定で使用されない変数は Optimize プロパティが false に設定されます。で示されているように、ドット表記を使用して変数を更新できます。

バージョン履歴

R2016b で導入