From 7cd91f459d744bdc6dbc8003de9b6aa2d0c1b3b5 Mon Sep 17 00:00:00 2001 From: genvalen Date: Sun, 24 Oct 2021 00:12:05 -0400 Subject: [PATCH 1/3] Remove empirical_covariance from FUNCTION_DOCSTRING_IGNORE_LIST --- maint_tools/test_docstrings.py | 1 - 1 file changed, 1 deletion(-) diff --git a/maint_tools/test_docstrings.py b/maint_tools/test_docstrings.py index c538768b3b6d8..8ca9621e0bd37 100644 --- a/maint_tools/test_docstrings.py +++ b/maint_tools/test_docstrings.py @@ -30,7 +30,6 @@ "sklearn.cluster._optics.compute_optics_graph", "sklearn.cluster._spectral.spectral_clustering", "sklearn.compose._column_transformer.make_column_transformer", - "sklearn.covariance._empirical_covariance.empirical_covariance", "sklearn.covariance._empirical_covariance.log_likelihood", "sklearn.covariance._graph_lasso.graphical_lasso", "sklearn.covariance._robust_covariance.fast_mcd", From 327cfaffc9805ece40fce02d639fbacec900d245 Mon Sep 17 00:00:00 2001 From: genvalen Date: Sun, 24 Oct 2021 00:16:32 -0400 Subject: [PATCH 2/3] Ensure empirical_covariance passes numpydoc validation --- sklearn/covariance/_empirical_covariance.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sklearn/covariance/_empirical_covariance.py b/sklearn/covariance/_empirical_covariance.py index b9fd47e160a2d..29596fe966dae 100644 --- a/sklearn/covariance/_empirical_covariance.py +++ b/sklearn/covariance/_empirical_covariance.py @@ -49,13 +49,12 @@ def log_likelihood(emp_cov, precision): def empirical_covariance(X, *, assume_centered=False): - """Computes the Maximum likelihood covariance estimator - + """Compute the Maximum likelihood covariance estimator. Parameters ---------- X : ndarray of shape (n_samples, n_features) - Data from which to compute the covariance estimate + Data from which to compute the covariance estimate. assume_centered : bool, default=False If True, data will not be centered before computation. From d5a70a3b15232b07e6da361e9ab6de7ba594b1e6 Mon Sep 17 00:00:00 2001 From: genvalen Date: Sun, 24 Oct 2021 00:28:57 -0400 Subject: [PATCH 3/3] Add backticks to bool values in docstring --- sklearn/covariance/_empirical_covariance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sklearn/covariance/_empirical_covariance.py b/sklearn/covariance/_empirical_covariance.py index 29596fe966dae..4fbb2aa0a826d 100644 --- a/sklearn/covariance/_empirical_covariance.py +++ b/sklearn/covariance/_empirical_covariance.py @@ -57,10 +57,10 @@ def empirical_covariance(X, *, assume_centered=False): Data from which to compute the covariance estimate. assume_centered : bool, default=False - If True, data will not be centered before computation. + If `True`, data will not be centered before computation. Useful when working with data whose mean is almost, but not exactly zero. - If False, data will be centered before computation. + If `False`, data will be centered before computation. Returns -------