Skip to content

Commit 9cddedf

Browse files
authored
MAINT Parameters validation for sklearn.covariance.ledoit_wolf_shrinkage (#26200)
1 parent c504f7a commit 9cddedf

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

sklearn/covariance/_shrunk_covariance.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,13 @@ def fit(self, X, y=None):
272272
# Ledoit-Wolf estimator
273273

274274

275+
@validate_params(
276+
{
277+
"X": ["array-like"],
278+
"assume_centered": ["boolean"],
279+
"block_size": [Interval(Integral, 1, None, closed="left")],
280+
}
281+
)
275282
def ledoit_wolf_shrinkage(X, assume_centered=False, block_size=1000):
276283
"""Estimate the shrunk Ledoit-Wolf covariance matrix.
277284

sklearn/tests/test_public_functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def _check_function_param_validation(
117117
"sklearn.cluster.cluster_optics_xi",
118118
"sklearn.cluster.ward_tree",
119119
"sklearn.covariance.empirical_covariance",
120+
"sklearn.covariance.ledoit_wolf_shrinkage",
120121
"sklearn.covariance.shrunk_covariance",
121122
"sklearn.datasets.dump_svmlight_file",
122123
"sklearn.datasets.fetch_20newsgroups",

0 commit comments

Comments
 (0)