10000 MAINT Parameters validation for datasets.make_sparse_spd_matrix (#26009) · Veghit/scikit-learn@68e0384 · GitHub
[go: up one dir, main page]

Skip to content

Commit 68e0384

Browse files
Théophile BarangerItay
authored andcommitted
MAINT Parameters validation for datasets.make_sparse_spd_matrix (scikit-learn#26009)
1 parent 1be0930 commit 68e0384

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

sklearn/datasets/_samples_generator.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,6 +1537,16 @@ def make_spd_matrix(n_dim, *, random_state=None):
15371537
return X
15381538

15391539

1540+
@validate_params(
1541+
{
1542+
"dim": [Interval(Integral, 1, None, closed="left")],
1543+
"alpha": [Interval(Real, 0, 1, closed="both")],
1544+
"norm_diag": ["boolean"],
1545+
"smallest_coef": [Interval(Real, 0, 1, closed="both")],
1546+
"largest_coef": [Interval(Real, 0, 1, closed="both")],
1547+
"random_state": ["random_state"],
1548+
}
1549+
)
15401550
def make_sparse_spd_matrix(
15411551
dim=1,
15421552
*,

sklearn/tests/test_public_functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def _check_function_param_validation(
143143
"sklearn.datasets.make_multilabel_classification",
144144
"sklearn.datasets.make_regression",
145145
"sklearn.datasets.make_sparse_coded_signal",
146+
"sklearn.datasets.make_sparse_spd_matrix",
146147
"sklearn.datasets.make_sparse_uncorrelated",
147148
"sklearn.datasets.make_spd_matrix",
148149
"sklearn.decomposition.sparse_encode",

0 commit comments

Comments
 (0)
0