fitcecoc svm classifier error

5 visualizaciones (últimos 30 días)
Pradyumna Reddy
Pradyumna Reddy el 16 de Abr. de 2019
Respondida: Don Mathis el 13 de Mayo de 2019
I am using MATLAB R2018b. I have two matrices X_norm (2000*20 double) which has my normalized observations and matrix Y (2000 * 1 double) has the class labels. I want to get an svm classifier model using X_norm and Y.
I have executed the following line
Mdl = fitcecoc(X_norm,Y,'Learners','svm','BoxConstraint',0.1);
and I get an error showing "Error using classreg.learning.FitTemplate/fillIfNeeded (line 634), BoxConstraint is not a valid parameter name."
Could anyone help me out with this issue?
  1 comentario
Pradyumna Reddy
Pradyumna Reddy el 16 de Abr. de 2019
I have tried this:
params = hyperparameters('fitcecoc',X_norm,Y,'svm');
params(2).Name
It gives the output as 'BoxConstraint' but I am not able to edit the hyperparameter with the mentioned code line in the question.

Iniciar sesión para comentar.

Respuestas (1)

Don Mathis
Don Mathis el 13 de Mayo de 2019
You need to pass fitcecoc a templateSVM object to set an SVM hyperparameter,
Mdl = fitcecoc(X_norm, Y, 'Learners', templateSVM('BoxConstraint', 0.1))

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by