Skip to content

Commit 7671e54

Browse files
pm155glemaitre
andauthored
MAINT Parameters validation for sklearn.datasets.fetch_kddcup99 (#25463)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
1 parent 81f3b63 commit 7671e54

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

sklearn/datasets/_kddcup99.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from . import get_data_home
2323
from ._base import RemoteFileMetadata
2424
from ._base import load_descr
25+
from ..utils._param_validation import StrOptions, validate_params
2526
from ..utils import Bunch
2627
from ..utils import check_random_state
2728
from ..utils import shuffle as shuffle_method
@@ -46,6 +47,18 @@
4647
logger = logging.getLogger(__name__)
4748

4849

50+
@validate_params(
51+
{
52+
"subset": [StrOptions({"SA", "SF", "http", "smtp"}), None],
53+
"data_home": [str, None],
54+
"shuffle": ["boolean"],
55+
"random_state": ["random_state"],
56+
"percent10": ["boolean"],
57+
"download_if_missing": ["boolean"],
58+
"return_X_y": ["boolean"],
59+
"as_frame": ["boolean"],
60+
}
61+
)
4962
def fetch_kddcup99(
5063
*,
5164
subset=None,

sklearn/tests/test_public_functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def _check_function_param_validation(
103103
"sklearn.covariance.empirical_covariance",
104104
"sklearn.covariance.shrunk_covariance",
105105
"sklearn.datasets.fetch_california_housing",
106+
"sklearn.datasets.fetch_kddcup99",
106107
"sklearn.datasets.make_classification",
107108
"sklearn.datasets.make_sparse_coded_signal",
108109
"sklearn.decomposition.sparse_encode",

0 commit comments

Comments
 (0)