I want to get a formula for hyperplane in SVM classifier,
so I can calculate the probability of true classification for each sample according to distance from hyperplane.
For simplicity imagine MATLAB's own example,
load fisheriris
xdata = meas(51:end,3:4);
group = species(51:end);
svmStruct = svmtrain(xdata,group,'showplot',true);
Which gives,
Where the hyperplane is a line and I want the formula for that.
The hyperplane can also have a messy shape!
What can I do? maybe there are other ways.
Thanks for any help.
SVM-based classifier contains Support Vectors
to read it from
svmStruct
a bit more easily, usesvmtrain
call with"AUTOSCALE"
,false
:or
If you use the default '
autoscale
' option, then you will need to unwind the scaling using something rather ugly like this:( >>> https://www.mathworks.com/matlabcentral/newsreader/view_thread/249055 )
For construction of a separating Hyperplane from SVM-classifier internal data, you may be interested in >>> http://scikit-learn.org/stable/auto_examples/svm/plot_separating_hyperplane.html
Parameters for to plot the maximum margin separating hyperplane within a two-class separable dataset using a Support Vector Machines classifier with linear kernel