In [1]:
from sklearn import svm
In [6]:
x = [[0,0], [1,1], [1,0]]
y = [0,1,1]
In [7]:
clf = svm.SVC()
clf.fit(x,y)
Out[7]:
In [12]:
z = [2,2]
result = clf.predict([[2,2]])
print(result)
In [14]:
print(clf.support_vectors_)
print(clf.support_)
print(clf.n_support_)
In [15]:
x = [[0, 0], [1, 1]]
y = [0.5, 1.5]
clf = svm.SVR()
clf.fit(x, y)
Out[15]:
In [17]:
z = [[2,2]]
result = clf.predict([[2, 2]])
print(result)
In [ ]: