分类 - 鸢尾花(iris)数据集介绍( 鸢【音:yuān】)

鸢尾花(iris)数据集介绍( 鸢【音:yuān】)

flyfish

这份数据集年代久远,R.A Fisher在1936年发表的文章中被使用
在这里插入图片描述

在这里插入图片描述

iris ['aɪrɪs]
鸢尾花(iris)数据集,它共有4个属性列和一个品种类别列

在这里插入图片描述

sepal length(萼片长度)、
sepal width(萼片宽度)、
petal length(花瓣长度)、
petal width (花瓣宽度),
单位是厘米。
3个品种类别是Setosa、Versicolour、Virginica,样本数量150个,每类50个。

Attribute Information:
1. sepal length in cm
2. sepal width in cm
3. petal length in cm
4. petal width in cm
5. class:
-- Iris Setosa
-- Iris Versicolour
-- Iris Virginic

在这里插入图片描述
可视化显示 只绘制点,不绘制线

from sklearn.datasets import load_iris
import matplotlib.pyplot as plt
iris = load_iris()
X = iris['data']
y = iris['target']
names = iris['target_names']
feature_names = iris['feature_names']


fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16,8))
for target, target_name in enumerate(names):
    X_plot = X[y == target]
    ax1.plot(X_plot[:, 0], X_plot[:, 1], linestyle='none', marker='o', label=target_name)
ax1.set_xlabel(feature_names[0])
ax1.set_ylabel(feature_names[1])
ax1.legend();

for target, target_name in enumerate(names):
    X_plot = X[y == target]
    ax2.plot(X_plot[:, 2], X_plot[:, 3], linestyle='none', marker='o', label=target_name)
ax2.set_xlabel(feature_names[2])
ax2.set_ylabel(feature_names[3])
ax2.legend();

在这里插入图片描述
在这里插入图片描述
http://archive.ics.uci.edu/ml/datasets/Iris

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

二分掌柜的

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值