数字数据集

此数据集由1797 张8x8图像组成。每幅图片,如下图所示,都是手写数字。为了利用这样的8x8图形,我们必须首先将其转换为长度为64的特征向量。

有关此数据集的更多信息,请参见

print(__doc__)


# Code source: Gaël Varoquaux
# Modified for documentation by Jaques Grobler
# License: BSD 3 clause

from sklearn import datasets

import matplotlib.pyplot as plt

#Load the digits dataset
digits = datasets.load_digits()

#Display the first digit
plt.figure(1, figsize=(33))
plt.imshow(digits.images[-1], cmap=plt.cm.gray_r, interpolation='nearest')
plt.show()

脚本的总运行时间:(0分0.123秒)

Download Python source code: plot_digits_last_image.py

Download Jupyter notebook: plot_digits_last_image.ipynb