sklearn.datasets.load_digits(n_class=10, return_X_y=False)
[source]
Load and return the digits dataset (classification).
Each datapoint is a 8x8 image of a digit.
Classes | 10 |
Samples per class | ~180 |
Samples total | 1797 |
Dimensionality | 64 |
Features | integers 0-16 |
Read more in the User Guide.
Parameters: |
|
---|---|
Returns: |
|
To load the data and visualize the images:
>>> from sklearn.datasets import load_digits >>> digits = load_digits() >>> print(digits.data.shape) (1797, 64) >>> import matplotlib.pyplot as plt >>> plt.gray() >>> plt.matshow(digits.images[0]) >>> plt.show()
sklearn.datasets.load_digits
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.datasets.load_digits.html