Obtaining the hyperplane from svmclassify function?

4 次查看(过去 30 天)
Hi,
I am using the svmtrain()/svmclassify() function within the statistics toolbox to solve a classification problem (using a radial basis function). Is there a way of obtaining the hyperplane equation, or the parameters of the radial basis function?
Thanks Ed

回答(1 个)

Abhas
Abhas 2025-6-6
Hi @Ed,
When using "svmtrain" and "svmclassify" with a radial basis function (RBF) kernel in MATLAB, obtaining an explicit hyperplane equation isn't straightforward. This is because the RBF kernel maps data into an infinite-dimensional space, making the decision boundary nonlinear and not representable by a simple equation.
However, you can access the parameters of the trained model, such as support vectors, their corresponding coefficients (alphas), and the bias term. These components define the decision function used for classification.
After training your SVM model:
svmStruct = svmtrain(data, labels, 'kernel_function', 'rbf');
You can retrieve the model parameters:
  • Support Vectors: svmStruct.SupportVectors
  • Alpha Coefficients: svmStruct.Alpha
  • Bias Term: svmStruct.Bias
  • Kernel Function: svmStruct.KernelFunction
  • Kernel Parameters: svmStruct.KernelParameters
When training the SVM, you can specify the RBF kernel's sigma (width) parameter using the "RBF_Sigma" option:
svmStruct = svmtrain(data, labels, 'kernel_function', 'rbf', 'RBF_Sigma', sigma_value);
For more detailed information and examples, refer to the following resources:
I hope this helps!

类别

Help CenterFile Exchange 中查找有关 AI and Statistics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by