[Numpy-discussion] Maximum-margin linear classifier

Nathaniel Smith njs at pobox.com
Sun Nov 30 09:22:43 EST 2014


Hi Mohan,

While you might get responses here, you'll probably have better luck asking
on the scikit-learn list. (I assume you are using scikit-learn for the
svm?) That's where you'll find experts on the details of these models
hanging out - this is the list for numpy itself, and numpy doesn't include
svms or plotting support directly. (StackOverflow is also sometimes a good
place to try for general questions that aren't really specific to any one
project.)

Good luck!

-n
On 30 Nov 2014 07:36, "Mohan Radhakrishnan" <radhakrishnan.mohan at gmail.com>
wrote:

> Hi,
>        I am a beginner.
>
> I have 4 points and wish to plot the classifier separation line. I believe
> this code without the plot is correct.
>
> Can I look at sample plotting code(with basic explanation) for this simple
> SVM ?
>
> X = [[3,3], [7,2], [5,4], [8,3]]
>
> Y = [-1, -1, 1, 1]
>
> clf = svm.SVC(kernel='linear',C=2)
>
> clf.fit(X,Y)
>
>
> for i in range(4):
>
>     x = np.array(X[i])[0]*clf.coef_[0][0] + np.array(X[i])[1]*clf.coef_[0
> ][1] + clf.intercept_;
>
>     print x
>
>
> print clf.intercept_
>
> print clf.coef_
>
> Thanks,
> Mohan
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20141130/e1c2b74d/attachment.html>


More information about the NumPy-Discussion mailing list