mvpa2.datasets.sources.skl_data.skl_digits¶
-
mvpa2.datasets.sources.skl_data.
skl_digits
(n_class=10)¶ 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 Parameters: n_class : integer, between 0 and 10, optional (default=10)
The number of classes to return.
Returns: data : Bunch
Dictionary-like object, the interesting attributes are: ‘data’, the data to learn, ‘images’, the images corresponding to each sample, ‘target’, the classification labels for each sample, ‘target_names’, the meaning of the labels, and ‘DESCR’, the full description of the dataset.
Notes
This function has been auto-generated by wrapping load_digits() from the sklearn package. The documentation of this function has been kept verbatim. Consequently, the actual return value is not as described in the documentation, but the data is returned as a PyMVPA dataset.
Examples
To load the data and visualize the images:
>>> from sklearn.datasets import load_digits >>> digits = load_digits() >>> print(digits.data.shape) (1797, 64) >>> import pylab as pl >>> pl.gray() >>> pl.matshow(digits.images[0]) >>> pl.show()