How to change the default range of hyperparameters in fitcecoc function?

4 次查看(过去 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.
BoxConstraint = Positive values log-scaled in the range [1e-3,10]
KernelScale = Positive values log-scaled in the range [1e-3,10]
KernelFunction ='gaussian', , and 'polynomial'
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 个评论
Machine Learning Enthusiast
Thank you. How to change other parameters? For instance, for kernal functiion, I am trying to search only guassian and polynomial in the search space.
Name: 'KernelFunction'
Range: {'gaussian' 'linear' 'polynomial'}
Type: 'categorical'
Transform: 'none'
Optimize: 0
Name: 'Coding'
Range: {'onevsall' 'onevsone'}
Type: 'categorical'
Transform: 'none'
Optimize: 1

请先登录,再进行评论。

采纳的回答

Walter Roberson
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 个评论
Machine Learning Enthusiast
Thank you. How to change other parameters? For instance, for kernal functiion, I am trying to search only guassian and polynomial in the search space.
Name: 'KernelFunction'
Range: {'gaussian' 'linear' 'polynomial'}
Type: 'categorical'
Transform: 'none'
Optimize: 0
Name: 'Coding'
Range: {'onevsall' 'onevsone'}
Type: 'categorical'
Transform: 'none'
Optimize: 1

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Classification Ensembles 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by