'''随便测试'''


from sklearn.datasets import load_iris
import numpy as np
iris = load_iris()

train_data = np.concatenate((iris.data[0:40, :], iris.data[50:90, :], iris.data[100:140, :]), axis = 0)
train_target = np.concatenate((iris.target[0:40], iris.target[50:90], iris.target[100:140]), axis = 0)

test_data = np.concatenate((iris.data[40:50, :], iris.data[90:100, :], iris.data[140:150, :]), axis = 0)
test_target = np.concatenate((iris.target[40:50], iris.target[90:100], iris.target[140:150]), axis = 0)


from sklearn import svm
model = svm.SVC(kernel='linear',probability=True)
model.fit(train_data,train_target)

predict = model.predict(test_data)
print(predict)
prob = model.predict_proba(test_data)
print(prob)
