iris 鸢尾花数据集

简介

这是个鸢尾花的三分类的数据集, 太经典了. 这里描述一下.

tensorflow 的入门教程也有描述, 见 参考[1].
它的数据集要在运行代码时从网上下载, 因为 Great Fire Wall, 下载会失败. 所以介绍下 sci-kit learn 自带的, 用起来更方便.

features

四个数值特征. sepal length, sepal width, petal length, petal width.

lables

int类型, 对三种分类做编号.
0 表示 Iris setosa
1 表示 Iris versicolor
2 表示 Iris virginica

数据样例

sepal length,   sepal width,    petal length,   petal width,    species (label)
5.1,    3.3,    1.7,    0.5,    0 (Setosa)
5.0,    2.3,    3.3,    1.0,    1 (versicolor)
6.4,    2.8,    5.6,    2.2,    2 (virginica)

sklearn 导入

sci-learn kit 中自带此数据集.

from sklearn import datasets
iris = datasets.load_iris()
features=iris.data  # ndarray, shape is (150,4), dtype is float64
labels=iris.target # ndarray, shape is (150,), dtype is int32, range is [0,2]

参考

  1. classifying_irises_an_overview

猜你喜欢

转载自blog.csdn.net/chuchus/article/details/79608137