Finding SVM hyperplane equation for 2nd order polynomial
조회 수: 4 (최근 30일)
이전 댓글 표시
Jose Luis Villaescusa Nadal
2021년 1월 10일
댓글: Jose Luis Villaescusa Nadal
2021년 2월 6일
Hello, I was using the Support Vector Machine model calculation for a 2nd order hyperplane to separate two classes:
SVMmodel = fitcsvm(predictors,response, ...
'KernelFunction', 'polynomial', ...
'PolynomialOrder', 2, ...
'KernelScale', kernelscale, ...
'BoxConstraint', boxconstraint, ...
'Standardize', true, ...
'ClassNames',[1; 2]);
But the resulting function has the Beta parameters (that indicate the hyperplane equation) completely empty.
How can I find the equation then for the 2nd order hyperplane, or have the function provide me with the beta values?
Is this a bug?
This is what the resulting struct looks like:

Thanks a lot.
댓글 수: 0
채택된 답변
Aditya Patil
2021년 2월 4일
In SVM, the beta value is used to find score only in case of linear kernel, as either no feature transformation or explicit feature transformation is done. However in case of other kernels, the feature transformation is implicit(using the “kernel trick”), hence the beta value is never calculated.
This is further elaborated in the following equations. For the linear kernel,
, where
is bias. While for other kernels,
, where G is gram matrix. As this equation is not in terms of x, you can't get the score function in terms of x.
The predict function optionally provides scores. This can be used to plot the decision boundary. You can check the support vector machines for binary classification documentation for an example. As the score is distance of the point from the decision boundary, finding where the score is zero gives the decision boundary.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!