from sklearn.svm import SVC
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report,confusion_matrix
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import cross_val_score
# 1.获取数据集
data = np.loadtxt('极大值.csv',delimiter=',') #50*22
list1 = [1]*10+[2]*10+[3]*10+[4]*10+[5]*10 #5个样本,每个样本10批数据
data = np.c_[data,list1]
x = data[:,0:-1]
y = data[:,-1]
# 2.1划分训练集测试集
train_data, test_data1, train_label, test_label1 = train_test_split(x, y, random_state=6,
test_size=0.4) # sklearn.model_selection.
# 2.2划分实测的
test_data, pra_data, test_label, pra_label = train_test_split(test_data1, test_label1, random_state&