Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How to plot a hyper plane in 3D for the SVM results?
Replies: 4   Last Post: Apr 22, 2013 11:02 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Aaronne

Posts: 110
Registered: 6/2/11
How to plot a hyper plane in 3D for the SVM results?
Posted: Apr 22, 2013 7:41 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I just wondering how to plot a hyper plane of the SVM results.

For example, here we are using two features, we can plot the decision boundary in 2D.
But if how can we plot a hyper plane in 3D if we use 3 features?

load fisheriris;

features = meas(1:100,:);
featureSelcted = features(1:100,1:2); % For example, featureSelcted = features(1:100,1:3) can not be plotted
groundTruthGroup = species(1:100);


svmStruct = svmtrain(featureSelcted, groundTruthGroup, ...
'Kernel_Function', 'rbf', 'boxconstraint', Inf, 'showplot', true, 'Method', 'QP');
svmClassified = svmclassify(svmStruct,featureSelcted,'showplot',true);


A similar solution in R can be found at

http://stackoverflow.com/questions/8017427/plotting-data-from-an-svm-fit-hyperplane

but a Matlab implementation would be handy. Thanks very much.



A.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.