机器学习之决策树(四) (3)

3 下面我们对鸢尾花的案例再次进行分析

from sklearn.tree import DecisionTreeClassifier from sklearn.neighbors import KNeighborsClassifier from sklearn.linear_model import LogisticRegression #导包加载数据 from sklearn.datasets import load_iris iris = load_iris() data = iris.data target = iris.target # 特征选择?? 方差选择 data.std(axis=0) # array([0.82530129, 0.43214658, 1.75852918, 0.76061262]) train = data[:,[0,3]] import matplotlib.pyplot as plt %matplotlib inline plt.scatter(train[:,0],train[:,1],c=target)

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wpwjxx.html