このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。
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: 0
範囲が広がり、最適化で使用されるように、ハイパーパラメーター 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
予測子変数として Horsepower
と Weight
を、応答変数として 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
— 近似関数の名前
'fitcdiscr'
| 'fitcecoc'
| 'fitcensemble'
| 'fitcgam'
| 'fitckernel'
| 'fitcknn'
| 'fitclinear'
| 'fitcnb'
| 'fitcnet'
| 'fitcsvm'
| 'fitctree'
| 'fitrensemble'
| 'fitrgam'
| 'fitrgp'
| 'fitrkernel'
| 'fitrlinear'
| 'fitrnet'
| 'fitrsvm'
| 'fitrtree'
近似関数の名前。リストされている分類近似関数名または回帰近似関数名のいずれかを指定します。
FitFcnName
が 'fitcecoc'
、'fitcensemble'
または 'fitrensemble'
である場合、引数 LearnerType
で学習器のタイプも指定する必要があります。
例: 'fitctree'
predictors
— 予測子データ
予測子の列が D 列ある行列 | 予測子の列が D 列あるテーブル
予測子データ。予測子の列が D 列ある行列または table を指定します。D は予測子の個数です。
例: X
データ型: double
| logical
| char
| string
| table
| cell
| categorical
| datetime
response
— クラス ラベルまたは数値応答
グループ化変数 | スカラー
クラス ラベルまたは数値応答。グループ化変数 (グループ化変数を参照) またはスカラーを指定します。
例: Y
データ型: single
| double
| logical
| char
| string
| cell
LearnerType
— アンサンブル近似の学習器のタイプ
'Discriminant'
| 'Kernel'
| 'KNN'
| 'Linear'
| 'SVM'
| 'Tree'
| リストされている学習器のテンプレート
アンサンブル当てはめの学習器のタイプ。'Discriminant'
、'Kernel'
、'KNN'
、'Linear'
、'SVM'
、'Tree'
、またはこれらの学習器のテンプレートのいずれかを指定します。この引数は、FitFcnName
が 'fitcecoc'
、'fitcensemble'
または 'fitrensemble'
である場合に使用します。
'fitcensemble'
の場合、'Discriminant'
、'KNN'
、'Tree'
、または関連するテンプレートのみを指定できます。
'fitrensemble'
の場合、'Tree'
、または関連するテンプレートのみを指定できます。
例: 'Tree'
出力引数
VariableDescriptions
— 変数の説明
optimizableVariable
オブジェクトのベクトル
変数の説明。optimizableVariable
オブジェクトのベクトルとして返されます。変数には、範囲や変数の型など、既定のパラメーター セットがあります。使用可能な変数はすべて説明に含まれますが、'auto'
の設定で使用されない変数は Optimize
プロパティが false
に設定されます。例で示されているように、ドット表記を使用して変数を更新できます。
バージョン履歴
R2016b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)