How to change the default range of hyperparameters in fitcecoc function?
조회 수: 8 (최근 30일)
이전 댓글 표시
Is it possible to change the default paramater search range of fitcecoc function? I am trying to find the optimal paramters for SVM in custom range to reduce computational time. For example, I am trying to set below range for following parameters.
PolynomialOrder=[2,5]
Any suggestions in this regard would be highly appreciated.
Demo Example:
clc
clear all
load fisheriris
t = templateSVM();
results = fitcecoc(meas, species,'Learners',t,'OptimizeHyperparameters','auto',...
'HyperparameterOptimizationOptions',struct('Optimizer',...
'randomsearch'))
T=results.HyperparameterOptimizationResults
댓글 수: 3
Don Mathis
2021년 7월 26일
Walter Roberson's answer is correct. And then you pass 'params' as the value of the 'OptimizeHyperparameters' parameter.
채택된 답변
Walter Roberson
2021년 7월 26일
Set nondefault parameters by passing a vector of optimizableVariable objects that have nondefault values. For example,
load fisheriris
params = hyperparameters('fitcecoc',meas,species,'svm');
params(2).Range = [1e-4,1e6];
After you created params look at
{params.Name}
to see which variable is which, to know which one to set the Range for.
댓글 수: 2
Walter Roberson
2021년 8월 1일
I think you should be able to do
params(4).Range = {'gaussian', 'polynomial'};
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Classification Ensembles에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!