MATLAB Answers

MByk
0

Parameter Optimization using Simulated Annealing

MByk
さんによって質問されました 2017 年 12 月 18 日
最新アクティビティ MByk
さんによって コメントされました 2017 年 12 月 18 日
I am new to optimization and trying to understand the basics, so sorry if it is a dumb question. Is it possible to tune parameters (which is a search problem) of a classifier using simulated annealing or other optimization technique, just for an example optimum value of "k" in KNN (I know there is an automatic hyperparameter optimization for KNN)?

  0 件のコメント

サインイン to comment.

1 件の回答

Alan Weiss
回答者: Alan Weiss
2017 年 12 月 18 日
編集済み: Alan Weiss
2017 年 12 月 18 日
 採用された回答

Sure, you can do anything you want. It might not be a good idea, but feel free.
Write an objective function that is, say, the cross-validation error rate for a particular parameter. If you have k as your parameter, and a cross-valudation partition c, then you might have
fun = @(k)kfoldLoss(fitcknn(X,y,'CVPartition',c,...
'NumNeighbors',k));
The only problem with this is that k is an integer variable, and most optimizers (including simulannealbnd) work only with continuous parameters. But you could use mixed-integer ga to optimize this.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

  1 件のコメント

MByk
2017 年 12 月 18 日
Thank you very much greatly appreciated.

サインイン to comment.



Translated by