机器学习算法(九) K近邻算法-对模拟数据回归&KNN预处理和分类马绞痛数据
利用k近邻对模拟数据回归&KNN预处理和分类马绞痛数据import numpy as npimport matplotlib.pyplot as plt from sklearn.neighbors import KNeighborsRegressornp.random.seed(0)# random 40,1 0-5 matrix, axis=0,1 sort by column,rowX = np.sort(5 * np.random.rand(40, 1), axis =