hyperparameters
Variable descriptions for optimizing a fit function
Syntax
Description
returns the default variables for the given fit function. These are the variables
that apply when you set the VariableDescriptions = hyperparameters(FitFcnName,predictors,response)OptimizeHyperparameters name-value
argument to "auto".
returns the variables for an ensemble fit with specified learner type. This syntax
applies when VariableDescriptions = hyperparameters(FitFcnName,predictors,response,LearnerType)FitFcnName is "fitcecoc",
"fitcensemble", or "fitrensemble".
Examples
Obtain the default hyperparameters for the fitcsvm classifier.
Load the ionosphere data.
load ionosphereObtain the hyperparameters.
VariableDescriptions = hyperparameters('fitcsvm',X,Y);Examine all the hyperparameters.
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
Change the PolynomialOrder hyperparameter to have a wider range and to be used in an optimization.
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
Obtain the default hyperparameters for the fitrensemble ensemble regression function.
Load the carsmall data.
load carsmallUse Horsepower and Weight as predictor variables, and MPG as the response variable.
X = [Horsepower Weight]; Y = MPG;
Obtain the default hyperparameters for a Tree learner.
VariableDescriptions = hyperparameters('fitrensemble',X,Y,'Tree');
Examine all the hyperparameters.
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
Change the MaxNumSplits hyperparameter to have a wider range and to be used in an optimization.
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
Input Arguments
Name of the fitting function, specified as one of the listed classification, regression, or quantile regression fit function names.
Classification fit functions:
fitcdiscr,fitcecoc,fitcensemble,fitcgam,fitckernel,fitcknn,fitclinear,fitcnb,fitcnet,fitcsvm,fitctreeRegression fit functions:
fitrensemble,fitrgam,fitrgp,fitrkernel,fitrlinear,fitrnet,fitrsvm,fitrtreeQuantile regression fit functions:
fitrqlinear,fitrqnet
If FitFcnName is "fitcecoc",
"fitcensemble", or "fitrensemble",
then you also need to specify the learner type in the
LearnerType argument.
Example: "fitctree"
Predictor data, specified as a matrix with D predictor columns or a table with D predictor columns, where D is the number of predictors.
Example: X
Data Types: double | logical | char | string | table | cell | categorical | datetime
Class labels or numeric response, specified as a grouping variable (see Grouping Variables) or a scalar.
Example: Y
Data Types: single | double | logical | char | string | cell
Learner type for an ensemble fit, specified as "discriminant",
"ensemble", "kernel",
"knn", "linear",
"svm", "tree", or a template of
one of these learners. Use this argument when
FitFcnName is "fitcecoc",
"fitcensemble", or
"fitrensemble".
For "fitcensemble", you can specify only "discriminant",
"knn", "tree", or an associated
template.
For "fitrensemble", you can specify only "tree" or its
associated template.
Example: "tree"
Output Arguments
Variable descriptions, returned as a vector of optimizableVariable objects. The
variables have their default parameters set, such as range and variable
type. All eligible variables exist in the descriptions, but the variables
unused in the "auto" setting have their
Optimize property set to false.
You can update the variables by using dot notation, as shown in Examples.
Version History
Introduced in R2016bYou can use the hyperparameters function to see the eligible
and default hyperparameters for a quantile regression model. Additionally, you can
use the function to adjust the hyperparameters and their ranges. Specify
"fitrqlinear" or "fitrqnet" as the fitting
function name.
fitcecoc supports hyperparameter
optimization when you use ensemble binary learners. You can specify the OptimizeHyperparameters name-value argument when the Learners value is
"ensemble" or an ensemble template created using the
templateEnsemble function.
When you perform hyperparameter optimization using ensemble binary learners, the ensemble method must be
"AdaBoostM1","GentleBoost", or"LogitBoost", and the ensemble weak learners must be trees.The
"ensemble"value corresponds to an ensemble that uses an adaptive logistic regression aggregation method (LogitBoost), 100 learning cycles, and tree weak learners.
fitcecoc uses a default value of 70 for
MaxObjectiveEvaluations when performing Bayesian optimization
with ensemble binary learners. For more information, see HyperparameterOptimizationOptions.
You can use the hyperparameters function to see the
eligible and default hyperparameters for the ensemble binary learners. Additionally,
you can use the function to adjust the hyperparameters and their ranges. Specify
"fitcecoc" as the fitting function name and
"ensemble" or an ensemble template as the learner
type.
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)