Regularization for a svm classifier

24 ビュー (過去 30 日間)
B A
B A 2018 年 9 月 7 日
コメント済み: B A 2018 年 9 月 11 日
I am applying Regularization in SVM for classification, but I cannot find a specific command to do it. Is there a command for this? or I should apply SVM in one line then regularized it in the other line? I found "fitclinear" and I can apply regularization, but there is no way to add different Kernel to this command.
Thank you

採用された回答

Vishal Bhutani
Vishal Bhutani 2018 年 9 月 10 日
By my understanding you want to train a SVM for classification with regularization. As you might be aware that ‘fitclinear’ creates a linear classification model object that contains the results of fitting a binary support vector machine to the predictors X and class labels Y. And it allows to set regularization parameter. For different kernel like RBF or Gaussian, you can try ‘fitckernel’. Here is the documentation link for that:
Another thing you can try is using ‘fitcsvm’ and in that you can vary box-constraint parameter for regularization and also you can vary kernel functions. More regularization (small boxconstraint) means you allow more points in the margin. With no regularization (large box constraint, hard margin) you allow no data points in the margin. Regularization relaxes this constraint, and the smaller boxconstraint the wider the margin but the more data points lie within the margin. Here is the documentation link for that:
  3 件のコメント
Vishal Bhutani
Vishal Bhutani 2018 年 9 月 11 日
Hi, for polynomial kernel you can select the option ‘polynomial’ in ‘KernelFunction’ in fitcsvm. Link of the documentation is attached:
Hope it helps.
B A
B A 2018 年 9 月 11 日
I am aware of this command, but it does not apply regularization automatically. As you mentioned before I should provide a range for box constraint and see which range is the best. Actually, I am looking for a code to run it without changing any parameters. Thanks so much.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeClassification Trees についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by