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 ]

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


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


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

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.