Obtaining the hyperplane from svmclassify function?

4 vues (au cours des 30 derniers jours)
Ed
Ed le 15 Juil 2013
Réponse apportée : Abhas le 6 Juin 2025
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

Réponses (1)

Abhas
Abhas le 6 Juin 2025
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!

Catégories

En savoir plus sur AI and Statistics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by