Finding SVM hyperplane equation for 2nd order polynomial
6 次查看(过去 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!