Skip to content

Commit

Permalink
MAINT Parameters validation for datasets.make_swiss_roll (scikit-lear…
Browse files Browse the repository at this point in the history
  • Loading branch information
Théophile Baranger authored Mar 30, 2023
1 parent 70c489f commit 5f1c4f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sklearn/datasets/_samples_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1627,6 +1627,14 @@ def make_sparse_spd_matrix(
return prec


@validate_params(
{
"n_samples": [Interval(Integral, 1, None, closed="left")],
"noise": [Interval(Real, 0, None, closed="left")],
"random_state": ["random_state"],
"hole": ["boolean"],
}
)
def make_swiss_roll(n_samples=100, *, noise=0.0, random_state=None, hole=False):
"""Generate a swiss roll dataset.
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 @@ -146,6 +146,7 @@ def _check_function_param_validation(
"sklearn.datasets.make_sparse_spd_matrix",
"sklearn.datasets.make_sparse_uncorrelated",
"sklearn.datasets.make_spd_matrix",
"sklearn.datasets.make_swiss_roll",
"sklearn.decomposition.sparse_encode",
"sklearn.feature_extraction.grid_to_graph",
"sklearn.feature_extraction.img_to_graph",
Expand Down

0 comments on commit 5f1c4f2

Please sign in to comment.