Skip to content

Commit

Permalink
MAINT Parameters validation for datasets.make_biclusters (#25945)
Browse files Browse the repository at this point in the history
  • Loading branch information
Théophile Baranger authored Mar 27, 2023
1 parent 56c4255 commit fce9a77
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
17 changes: 14 additions & 3 deletions sklearn/datasets/_samples_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1802,6 +1802,17 @@ def _shuffle(data, random_state=None):
return result, row_idx, col_idx


@validate_params(
{
"shape": [tuple],
"n_clusters": [Interval(Integral, 1, None, closed="left")],
"noise": [Interval(Real, 0, None, closed="left")],
"minval": [Interval(Real, None, None, closed="neither")],
"maxval": [Interval(Real, None, None, closed="neither")],
"shuffle": ["boolean"],
"random_state": ["random_state"],
}
)
def make_biclusters(
shape,
n_clusters,
Expand All @@ -1818,7 +1829,7 @@ def make_biclusters(
Parameters
----------
shape : iterable of shape (n_rows, n_cols)
shape : tuple of shape (n_rows, n_cols)
The shape of the result.
n_clusters : int
Expand All @@ -1827,10 +1838,10 @@ def make_biclusters(
noise : float, default=0.0
The standard deviation of the gaussian noise.
minval : int, default=10
minval : float, default=10
Minimum value of a bicluster.
maxval : int, default=100
maxval : float, default=100
Maximum value of a bicluster.
shuffle : bool, default=True
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 @@ -129,6 +129,7 @@ def _check_function_param_validation(
"sklearn.datasets.fetch_olivetti_faces",
"sklearn.datasets.load_svmlight_file",
"sklearn.datasets.load_svmlight_files",
"sklearn.datasets.make_biclusters",
"sklearn.datasets.make_checkerboard",
"sklearn.datasets.make_circles",
"sklearn.datasets.make_classification",
Expand Down

0 comments on commit fce9a77

Please sign in to comment.