8000 DOC Ensures that OrthogonalMatchingPursuit passes numpydoc validation by mani2106 · Pull Request #21296 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

DOC Ensures that OrthogonalMatchingPursuit passes numpydoc validation #21296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 20, 2021
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
8000
Original file line numberDiff 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
0