Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion sklearn/datasets/_lfw.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

from os import listdir, makedirs, remove
from os.path import join, exists, isdir

from ..utils._param_validation import validate_params, Interval, Hidden
from numbers import Integral, Real
import logging

import numpy as np
Expand Down Expand Up @@ -231,6 +232,18 @@ def _fetch_lfw_people(
return faces, target, target_names


@validate_params(
{
"data_home": [str, None],
"funneled": ["boolean"],
"resize": [Interval(Real, 0, None, closed="neither"), None],
"min_faces_per_person": [Interval(Integral, 0, None, closed="left"), None],
"color": ["boolean"],
"slice_": [tuple, Hidden(None)],
"download_if_missing": ["boolean"],
"return_X_y": ["boolean"],
}
)
def fetch_lfw_people(
*,
data_home=None,
Expand Down
1 change: 1 addition & 0 deletions sklearn/tests/test_public_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def _check_function_param_validation(
"sklearn.datasets.fetch_california_housing",
"sklearn.datasets.fetch_covtype",
"sklearn.datasets.fetch_kddcup99",
"sklearn.datasets.fetch_lfw_people",
"sklearn.datasets.fetch_olivetti_faces",
"sklearn.datasets.load_svmlight_file",
"sklearn.datasets.load_svmlight_files",
Expand Down