8000 MAINT Parameters validation for datasets.make_biclusters (#25945) · scikit-learn/scikit-learn@fce9a77 · GitHub
[go: up one dir, main page]

Skip to content

Commit fce9a77

Browse files
author
Théophile Baranger
authored
MAINT Parameters validation for datasets.make_biclusters (#25945)
1 parent 56c4255 commit fce9a77

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

sklearn/datasets/_samples_generator.py

Lines changed: 14 additions & 3 deletions
1841
Original file line numberDiff line numberDiff line change
@@ -1802,6 +1802,17 @@ def _shuffle(data, random_state=None):
18021802
return result, row_idx, col_idx
18031803

18041804

1805+
@validate_params(
1806+
{
1807+
"shape": [tuple],
1808+
"n_clusters": [Interval(Integral, 1, None, closed="left")],
1809+
"noise": [Interval(Real, 0, None, closed="left")],
1810+
"minval": [Interval(Real, None, None, closed="neither")],
1811+
"maxval": [Interval(Real, None, None, closed="neither")],
1812+
"shuffle": ["boolean"],
1813+
"random_state": ["random_state"],
1814+
}
1815+
)
18051816
def make_biclusters(
18061817
shape,
18071818
n_clusters,
@@ -1818,7 +1829,7 @@ def make_biclusters(
18181829
18191830
Parameters
18201831
----------
1821-
shape : iterable of shape (n_rows, n_cols)
1832+
shape : tuple of shape (n_rows, n_cols)
18221833
The shape of the result.
18231834
18241835
n_clusters : int
@@ -1827,10 +1838,10 @@ def make_biclusters(
18271838
noise : float, default=0.0
18281839
The standard deviation of the gaussian noise.
18291840
1830-
minval : int, default=10
+
minval : float, default=10
18311842
Minimum value of a bicluster.
18321843
1833-
maxval : int, default=100
1844+
maxval : float, default=100
18341845
Maximum value of a bicluster.
18351846
18361847
shuffle : bool, default=True

sklearn/tests/test_public_functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def _check_function_param_validation(
129129
"sklearn.datasets.fetch_olivetti_faces",
130130
"sklearn.datasets.load_svmlight_file",
131131
"sklearn.datasets.load_svmlight_files",
132+
"sklearn.datasets.make_biclusters",
132133
"sklearn.datasets.make_checkerboard",
133134
"sklearn.datasets.make_circles",
134135
"sklearn.datasets.make_classification",

0 commit comments

Comments
 (0)
0