How to fix coding method (e.g.,'onevsall') in performing hyperparameter optimzation in multi-class svm (i.e., fitcecoc.m)

조회 수: 3 (최근 30일)
The function fitcecoc.m allow to optimize hyperparamters for multi-class svm by seting up the parameter-vlaue pairs for 'OptimizeHyperparameters' and or 'HyperparameterOptimizationOptions', e.g.:
mdl = fitcecoc(x,y,'OptimizeHyperparameters','auto')
The code above will actually optimize three hyperparameters: coding (using either of ['onevsone' 'onevsall'], box constraint and kernel scale. I wonder if there is any way to fix the coding method (ie., not optimize the coding hyperparameter but use 'onevsall' not 'onevsone' that is set by default) and only optimize the two other hyperparameters.
It is found that even if a specific parameter-value pair of 'coding' and 'onevsall' is provided as arguments of fitcecoc.m, the hyperaparmeter optimation will override the coding method provided and use 'onevsone' for coding.

답변 (1개)

Don Mathis
Don Mathis 2018년 10월 26일
편집: Don Mathis 2018년 10월 26일
You are right that the optimization overrides statically specified variables values. That's mentioned in this "Note" on the Doc page for fitcecoc . So you will need to pass the variables to be optimized individually, like this:
mdl = fitcecoc(x,y,'Coding','onevsall','OptimizeHyperparameters',{'KernelScale','BoxConstraint'})

카테고리

Help CenterFile Exchange에서 Classification에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by