Borrar filtros
Borrar filtros

I am using a linear svm an i would like to tune the boxconstraint parameter.

1 visualización (últimos 30 días)
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

Respuesta aceptada

Cindy Solomon
Cindy Solomon el 6 de Mayo de 2015
Editada: Cindy Solomon el 6 de Mayo de 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!

Más respuestas (0)

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by