from sklearn import svm
# 使用svm分类demo
# sklearn.svm.SVC(C=1.0, kernel='rbf', degree=3, gamma='auto', coef0=0.0, shrinking=True, probability=False,
# tol=0.001, cache_size=200, class_weight=None, verbose=False, max_iter=-1, decision_function_shape=None,random_state=None)
X = [[0,0],[1,9],[9,1],[6,5]]
y = [0,0,1,1]
# probability 为true可以打印分类概率
clf = svm.SVC(probability = True)
clf.fit(X,y)
x_test = [[1,7]]
result = clf.predict(x_test)
# 预测输出
print(result)
# 分类概率
print(clf.predict_proba(x_test))