https://ftp.bmp.ovh/imgs/2021/07/7f4988ae3b43e55d.jpg

决策树1-分类器

代码 1 2 3 4 5 import numpy as np import matplotlib.pyplot as plt from sklearn import datasets from sklearn.model_selection import train_test_split #分割训练集和测试集 from sklearn.neighbors import KNeighborsClassifier #K近邻 简单案例 1 2 3 iris=datasets.load_iris() iris_X = iris.data iris_y=iris.target 1 iris_X[:2,:]#四个属