フィルターのクリア

OptimizeHyperparameters option to tune soft margin SVM classifier

1 回表示 (過去 30 日間)
Atheer Alkubeyyer
Atheer Alkubeyyer 2019 年 4 月 9 日
コメント済み: Felipe Assunção 2020 年 4 月 3 日
Hello,
I am building an SVM model with soft margin for calssifying images dataset of 900 instants, into two calsses, but I need to tune the hyperparameter 'Boxconstraint', and I am using 'OptimizeHyperparameters' for such purpose, as below code, however, it takes long time to run the optimizer, around 90 seconds, while if i use the 'rbf' model, it takes less time. I wonder what cause this issue. are there any suggestions to avoid or improve this.
Also, If i want to build a hard margin SVM using 'fitcsvm' function, should I set the parameter 'BoxConstraint' to very high value?
c = cvpartition(data_lables,'k',10);
opts = struct('Optimizer','bayesopt','ShowPlots',false,'CVPartition',c,...
'AcquisitionFunctionName','expected-improvement-plus');
svmmod = fitcsvm(data_features,data_lables,'KernelFunction','linear','CacheSize','maximal',...
'OptimizeHyperparameters','auto','HyperparameterOptimizationOptions',opts);
  2 件のコメント
Don Mathis
Don Mathis 2019 年 4 月 12 日
As for the runtime, linear SVM can often be much slower than RBF SVM, depending on the combination of BoxConstraint and KernelScale. The optimization will sometimes explore those combinations. I don't think it's possible to avoid that when doing hyperparameter search.
Felipe Assunção
Felipe Assunção 2020 年 4 月 3 日
I also see the same problem for using ftcecoc or fitcensemble (which takes much longer).
When I do the optimization, should I consider my entire dataset that I will use in the classification or would it be just a part? I have currently used my entire set.
Beside this, about this optimization model, should I specify cross-validation in this optimization or just in my classifier?

サインインしてコメントする。

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by