Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fd8f508

Browse filesBrowse files
Théophile Barangeransamz
Théophile Baranger
authored andcommitted
MAINT Parameters validation for datasets.make_spd_matrix (scikit-learn#26003)
1 parent 269b007 commit fd8f508
Copy full SHA for fd8f508

File tree

Expand file treeCollapse file tree

2 files changed

+7
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-0
lines changed

‎sklearn/datasets/_samples_generator.py

Copy file name to clipboardExpand all lines: sklearn/datasets/_samples_generator.py
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,6 +1498,12 @@ def make_sparse_uncorrelated(n_samples=100, n_features=10, *, random_state=None)
14981498
return X, y
14991499

15001500

1501+
@validate_params(
1502+
{
1503+
"n_dim": [Interval(Integral, 1, None, closed="left")],
1504+
"random_state": ["random_state"],
1505+
}
1506+
)
15011507
def make_spd_matrix(n_dim, *, random_state=None):
15021508
"""Generate a random symmetric, positive-definite matrix.
15031509

‎sklearn/tests/test_public_functions.py

Copy file name to clipboardExpand all lines: sklearn/tests/test_public_functions.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def _check_function_param_validation(
144144
"sklearn.datasets.make_regression",
145145
"sklearn.datasets.make_sparse_coded_signal",
146146
"sklearn.datasets.make_sparse_uncorrelated",
147+
"sklearn.datasets.make_spd_matrix",
147148
"sklearn.decomposition.sparse_encode",
148149
"sklearn.feature_extraction.grid_to_graph",
149150
"sklearn.feature_extraction.img_to_graph",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.