The Digit Dataset

This dataset is made up of 1797 8x8 images. Each image, like the one shown below, is of a hand-written digit. In order to utilize an 8x8 figure like this, we?d have to first transform it into a feature vector with length 64.

See here for more information about this dataset.

../../_images/sphx_glr_plot_digits_last_image_001.png

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
print(__doc__)
 
 
# Code source: Ga 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=(3, 3))
plt.imshow(digits.images[-1], cmap=plt.cm.gray_r, interpolation='nearest')
plt.show()

Total running time of the script: (0 minutes 0.204 seconds)

Download Python source code: plot_digits_last_image.py
Download IPython notebook: plot_digits_last_image.ipynb
doc_scikit_learn
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.