knn分类iris数据
题目
Sklearn中的datasets方法导入iris鸢尾花训练样本并用train_test_split产生测试样本,用KNN分类并输出分类精度。
data = sklearn.datasets.iris.data
label = sklearn.datasets.iris.target
输出
代码
from sklearn import datasets
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklea
2024-02-29 11:55:39
31KB
iris
1