# coding:utf-8 import numpy as np import matplotlib.pyplot as plt from sklearn.neighbors import KNeighborsClassifier # 1.数据读取 x_tain =[] x_test =[] y_tain=[] y_test=[] for i in range(0,10): for j in range(1,501): if j < 451: #将数据保存到训练数据中 x_tain.appen…