From 4aa6556257476a8625d7a65d6f2fa2ffd4c07057 Mon Sep 17 00:00:00 2001 From: spikebh Date: Fri, 22 Oct 2021 16:14:05 -0300 Subject: [PATCH] DOC Ensures that OrthogonalMatchingPursuitCV passes numpydoc validation --- maint_tools/test_docstrings.py | 1 - sklearn/linear_model/_omp.py | 31 ++++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/maint_tools/test_docstrings.py b/maint_tools/test_docstrings.py index 3afc2b9e5cc18..6c9a71f1d05e3 100644 --- a/maint_tools/test_docstrings.py +++ b/maint_tools/test_docstrings.py @@ -15,7 +15,6 @@ DOCSTRING_IGNORE_LIST = [ "LabelSpreading", "MultiTaskElasticNetCV", - "OrthogonalMatchingPursuitCV", "PassiveAggressiveRegressor", "SpectralCoclustering", "SpectralEmbedding", diff --git a/sklearn/linear_model/_omp.py b/sklearn/linear_model/_omp.py index 0dad398104143..8b94e4a32087f 100644 --- a/sklearn/linear_model/_omp.py +++ b/sklearn/linear_model/_omp.py @@ -880,7 +880,7 @@ class OrthogonalMatchingPursuitCV(RegressorMixin, LinearModel): copy is made anyway. fit_intercept : bool, default=True - whether to calculate the intercept for this model. If set + Whether to calculate the intercept for this model. If set to false, no intercept will be used in calculations (i.e. data is expected to be centered). @@ -953,6 +953,20 @@ class OrthogonalMatchingPursuitCV(RegressorMixin, LinearModel): .. versionadded:: 1.0 + See Also + -------- + orthogonal_mp : Solves n_targets Orthogonal Matching Pursuit problems. + orthogonal_mp_gram : Solves n_targets Orthogonal Matching Pursuit + problems using only the Gram matrix X.T * X and the product X.T * y. + lars_path : Compute Least Angle Regression or Lasso path using LARS algorithm. + Lars : Least Angle Regression model a.k.a. LAR. + LassoLars : Lasso model fit with Least Angle Regression a.k.a. Lars. + OrthogonalMatchingPursuit : Orthogonal Matching Pursuit model (OMP). + LarsCV : Cross-validated Least Angle Regression model. + LassoLarsCV : Cross-validated Lasso model fit with Least Angle Regression. + sklearn.decomposition.sparse_encode : Generic sparse coding. + Each column of the result is the solution to a Lasso problem. + Examples -------- >>> from sklearn.linear_model import OrthogonalMatchingPursuitCV @@ -966,19 +980,6 @@ class OrthogonalMatchingPursuitCV(RegressorMixin, LinearModel): 10 >>> reg.predict(X[:1,]) array([-78.3854...]) - - See Also - -------- - orthogonal_mp - orthogonal_mp_gram - lars_path - Lars - LassoLars - OrthogonalMatchingPursuit - LarsCV - LassoLarsCV - sklearn.decomposition.sparse_encode - """ def __init__( @@ -1014,7 +1015,7 @@ def fit(self, X, y): Returns ------- self : object - returns an instance of self. + Returns an instance of self. """ _normalize = _deprecate_normalize(