Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion maint_tools/test_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"MultiTaskElasticNetCV",
"MultiTaskLasso",
"MultiTaskLassoCV",
"OrthogonalMatchingPursuit",
"OrthogonalMatchingPursuitCV",
"PassiveAggressiveClassifier",
"PassiveAggressiveRegressor",
Expand Down
44 changes: 23 additions & 21 deletions sklearn/linear_model/_omp.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ class OrthogonalMatchingPursuit(MultiOutputMixin, RegressorMixin, LinearModel):
Maximum norm of the residual. If not None, overrides n_nonzero_coefs.

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).

Expand Down Expand Up @@ -653,16 +653,18 @@ class OrthogonalMatchingPursuit(MultiOutputMixin, RegressorMixin, LinearModel):

.. versionadded:: 1.0

Examples
See Also
--------
>>> from sklearn.linear_model import OrthogonalMatchingPursuit
>>> from sklearn.datasets import make_regression
>>> X, y = make_regression(noise=4, random_state=0)
>>> reg = OrthogonalMatchingPursuit(normalize=False).fit(X, y)
>>> reg.score(X, y)
0.9991...
>>> reg.predict(X[:1,])
array([-78.3854...])
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.
sklearn.decomposition.sparse_encode : Generic sparse coding.
Each column of the result is the solution to a Lasso problem.
OrthogonalMatchingPursuitCV : Cross-validated
Orthogonal Matching Pursuit model (OMP).

Notes
-----
Expand All @@ -676,15 +678,16 @@ class OrthogonalMatchingPursuit(MultiOutputMixin, RegressorMixin, LinearModel):
Matching Pursuit Technical Report - CS Technion, April 2008.
https://www.cs.technion.ac.il/~ronrubin/Publications/KSVD-OMP-v2.pdf

See Also
Examples
--------
orthogonal_mp
orthogonal_mp_gram
lars_path
Lars
LassoLars
sklearn.decomposition.sparse_encode
OrthogonalMatchingPursuitCV
>>> from sklearn.linear_model import OrthogonalMatchingPursuit
>>> from sklearn.datasets import make_regression
>>> X, y = make_regression(noise=4, random_state=0)
>>> reg = OrthogonalMatchingPursuit(normalize=False).fit(X, y)
>>> reg.score(X, y)
0.9991...
>>> reg.predict(X[:1,])
array([-78.3854...])
"""

def __init__(
Expand All @@ -711,13 +714,12 @@ def fit(self, X, y):
Training data.

y : array-like of shape (n_samples,) or (n_samples, n_targets)
Target values. Will be cast to X's dtype if necessary

Target values. Will be cast to X's dtype if necessary.

Returns
-------
self : object
returns an instance of self.
Returns an instance of self.
"""
_normalize = _deprecate_normalize(
self.normalize, default=True, estimator_name=self.__class__.__name__
Expand Down