fitcecoc svm classifier error

조회 수: 4 (최근 30일)
Pradyumna Reddy
Pradyumna Reddy 2019년 4월 16일
답변: Don Mathis 2019년 5월 13일
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
Pradyumna Reddy
Pradyumna Reddy 2019년 4월 16일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Don Mathis
Don Mathis 2019년 5월 13일
You need to pass fitcecoc a templateSVM object to set an SVM hyperparameter,
Mdl = fitcecoc(X_norm, Y, 'Learners', templateSVM('BoxConstraint', 0.1))

카테고리

Help CenterFile Exchange에서 Classification에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by