I am using a linear svm an i would like to tune the boxconstraint parameter.
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Konstantinos Mitr
le 4 Mai 2015
Modifié(e) : Cindy Solomon
le 6 Mai 2015
I am using a linear svm and i would like to tune the boxconstraint parameter. I have tried different values but there are no results. my svm looks like:
svmtrain(trainingFeatures, trainingLabels,'Kernel_Function','linear',... 'boxconstraint',C,'tolkkt',(1e-3),'kktviolationlevel', 0);
trainingFeatures=[TrainingDataPositive;TrainingDataNegative];
size(TrainingDataNegative)=21354x1297 size(TrainingDataPositive)=8380x1297
How can i tune boxconstraint parameter( C parameter)in order to see different ErroRates (from function classperf) and pick the minimum.
Thanks
0 commentaires
Réponse acceptée
Cindy Solomon
le 6 Mai 2015
Modifié(e) : Cindy Solomon
le 6 Mai 2015
Hi Konstantinos,
The adjustments you would make would highly depend on your specific data, but to clarify how the BoxConstraint impacts your SVM, this parameter lets you specify the soft margin in the SVM classifier you train. This in turn lets you control the trade-off between margin width and misclassification by specifying a single (scalar) value that specifies the soft margin for all vectors. To specify a hard margin, you can set this value to a very large number. Theoretically it could be set to infinity (inf in MATLAB), but this may cause numerical stability issues in the optimization algorithm and increases the training time (although it will also decrease the number of support vectors). In addition, I would recommend using "fitcsvm" instead of "svmtrain", as svmtrain will be removed in a future release of MATLAB.
Hope this helps!
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!