Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.datasets`.fetch_olivetti_faces

sklearn.datasets.fetch_olivetti_faces(*, data_home=None, shuffle=False, random_state=0, download_if_missing=True, return_X_y=False)

  Load the Olivetti faces data-set from AT&T (classification).

  Download it if necessary.

  Classes | 40
  Samples total | 400
  Dimensionality | 4096
  Features | real, between 0 and 1

  Read more in the User Guide.

  Parameters:
    data_home str or path-like, default=None

      Specify another download and cache folder for the datasets. By default all scikit-learn data is stored in ‘~/scikit_learn_data’ subfolders.

    shuffle bool, default=False

      If True the order of the dataset is shuffled to avoid having images of the same person grouped.

    random_state int, RandomState instance or None, default=0

      Determines random number generation for dataset shuffling. Pass an int for reproducible output across multiple function calls. See Glossary.

    download_if_missing bool, default=True

      If False, raise an OSError if the data is not locally available instead of trying to download the data from the source site.

    return_X_y bool, default=False

      If True, returns `(data, target)` instead of a `Bunch` object. See below for more information about the `data` and `target` object.

      New in version 0.22.

  Returns:
    data `Bunch`

      Dictionary-like object, with the following attributes.

      data: ndarray, shape (400, 4096)

        Each row corresponds to a ravelled face image of original size 64 x 64 pixels.

      imagesndarray, shape (400, 64, 64)

        Each row is a face image corresponding to one of the 40 subjects of the dataset.

      targetndarray, shape (400,)

        Labels associated to each face image. Those labels are ranging from 0-39 and correspond to the Subject IDs.

      DESCRstr

        Description of the modified Olivetti Faces Dataset.

    (data, target)tuple if `return_X_y=True`

      Tuple with the `data` and `target` objects described above.

      New in version 0.22.

## Examples using `sklearn.datasets.fetch_olivetti_faces`

Online learning of a dictionary of parts of faces

Online learning of a dictionary of parts of faces

Faces dataset decompositions

Faces dataset decompositions

Pixel importances with a parallel forest of trees

Pixel importances with a parallel forest of trees

Face completion with a multi-output estimators

Face completion with a multi-output estimators