Skip to content

DOC Ensures that LassoLarsCV passes numpydoc validation #20462

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 53 commits into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1a7f2fb
Update default doc string values
genvalen Jun 6, 2020
ca94a79
Update default docstrings for Metrics
genvalen Jun 7, 2020
cc09f9d
Fix lint error
genvalen Jun 7, 2020
a899bef
Merge remote-tracking branch 'upstream/master' into linear-model-defa…
genvalen Jun 7, 2020
c8cd424
Resolve merge conflicts
genvalen Jun 7, 2020
da935ac
Fix flake8 error
genvalen Jun 7, 2020
bede6d0
Update sklearn/metrics/_classification.py
genvalen Jun 9, 2020
7b4647e
Update sklearn/metrics/_classification.py
genvalen Jun 9, 2020
cfe8b2b
Update sklearn/metrics/_base.py
genvalen Jun 9, 2020
1ec16e8
Update sklearn/metrics/_classification.py
genvalen Jun 9, 2020
5e52205
Update sklearn/metrics/_classification.py
genvalen Jun 9, 2020
8df195e
Update sklearn/metrics/_classification.py
genvalen Jun 9, 2020
c93effd
Update sklearn/metrics/pairwise.py
genvalen Jun 9, 2020
57ca202
Update sklearn/metrics/pairwise.py
genvalen Jun 9, 2020
3937592
Update sklearn/metrics/pairwise.py
genvalen Jun 9, 2020
a069d00
Update sklearn/metrics/pairwise.py
genvalen Jun 9, 2020
a82ee38
Update sklearn/metrics/pairwise.py
genvalen Jun 9, 2020
572ca85
Update sklearn/metrics/_classification.py
genvalen Jun 9, 2020
89af371
Update sklearn/metrics/_classification.py
genvalen Jun 9, 2020
601c757
Update sklearn/metrics/_classification.py
genvalen Jun 9, 2020
4ed3830
Update sklearn/metrics/_classification.py
genvalen Jun 9, 2020
1fa4425
Update sklearn/metrics/_classification.py
genvalen Jun 9, 2020
48a5908
Update sklearn/metrics/_classification.py
genvalen Jun 9, 2020
881f733
Update sklearn/metrics/_classification.py
genvalen Jun 9, 2020
c85c836
Update sklearn/metrics/_classification.py
genvalen Jun 9, 2020
9286fcb
Update sklearn/metrics/_classification.py
genvalen Jun 9, 2020
8367323
Update sklearn/metrics/_ranking.py
genvalen Jun 9, 2020
056c8e9
Update sklearn/metrics/_classification.py
genvalen Jun 10, 2020
036b8b6
Update sklearn/metrics/_classification.py
genvalen Jun 10, 2020
1a83796
Update sklearn/metrics/_classification.py
genvalen Jun 10, 2020
a3d0e1a
Update sklearn/metrics/_ranking.py
genvalen Jun 10, 2020
8573644
Update sklearn/metrics/_ranking.py
genvalen Jun 11, 2020
c291010
Update sklearn/metrics/_ranking.py
genvalen Jun 11, 2020
40dc8b0
Update sklearn/metrics/_ranking.py
genvalen Jun 12, 2020
769e6fb
Update sklearn/metrics/_ranking.py
genvalen Jun 12, 2020
0848721
Update sklearn/metrics/_regression.py
genvalen Jun 12, 2020
37963a2
Apply suggestions from code review
genvalen Jun 12, 2020
dc5cc39
Make edits
genvalen Jun 12, 2020
711658b
Make edits
genvalen Jun 12, 2020
808e240
Fix merge conflicts
genvalen Jun 11, 2021
0da8b25
Fix another merge conflict
genvalen Jun 11, 2021
abeeb66
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
genvalen Jun 12, 2021
12082a8
Merge remote-tracking branch 'upstream/main' into main
genvalen Jun 20, 2021
f592334
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
genvalen Jun 26, 2021
c826dc9
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
genvalen Jun 29, 2021
1f701ee
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
genvalen Jun 29, 2021
20ab7df
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
genvalen Jun 30, 2021
0c63c29
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
genvalen Jul 2, 2021
0fa9b85
Accept incoming change from previous merge
genvalen Jul 2, 2021
d0ba89b
Remove LassoLarsCV from DOCSTRING_IGNORE_LIST.
genvalen Jul 3, 2021
a6ad6bc
Ensure LassoLarsCV passes numpydoc validation
genvalen Jul 3, 2021
aca2749
Merge branch 'main' into LassoLarsCV
glemaitre Jul 6, 2021
c14b96a
Merge branch 'main' into LassoLarsCV
glemaitre Jul 6, 2021
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 @@ -73,7 +73,6 @@
"LabelSpreading",
"LarsCV",
"LassoCV",
"LassoLarsCV",
"LatentDirichletAllocation",
"LedoitWolf",
"LinearSVR",
Expand Down
43 changes: 26 additions & 17 deletions sklearn/linear_model/_least_angle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1630,7 +1630,7 @@ def fit(self, X, y):
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 Expand Up @@ -1733,7 +1733,7 @@ class LassoLarsCV(LarsCV):
Parameters
----------
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 @@ -1779,7 +1779,7 @@ class LassoLarsCV(LarsCV):

max_n_alphas : int, default=1000
The maximum number of points on the path used to compute the
residuals in the cross-validation
residuals in the cross-validation.

n_jobs : int or None, default=None
Number of CPUs to use during the cross validation.
Expand Down Expand Up @@ -1844,22 +1844,22 @@ class LassoLarsCV(LarsCV):

.. versionadded:: 0.24

Examples
See Also
--------
>>> from sklearn.linear_model import LassoLarsCV
>>> from sklearn.datasets import make_regression
>>> X, y = make_regression(noise=4.0, random_state=0)
>>> reg = LassoLarsCV(cv=5, normalize=False).fit(X, y)
>>> reg.score(X, y)
0.9993...
>>> reg.alpha_
0.3972...
>>> reg.predict(X[:1,])
array([-78.4831...])
lars_path : Compute Least Angle Regression or Lasso
path using LARS algorithm.
lasso_path : Compute Lasso path with coordinate descent.
Lasso : Linear Model trained with L1 prior as
regularizer (aka the Lasso).
LassoCV : Lasso linear model with iterative fitting
along a regularization path.
LassoLars : Lasso model fit with Least Angle Regression a.k.a. Lars.
LassoLarsIC : Lasso model fit with Lars using BIC
or AIC for model selection.
sklearn.decomposition.sparse_encode : Sparse coding.

Notes
-----

The object solves the same problem as the LassoCV object. However,
unlike the LassoCV, it find the relevant alphas values by itself.
In general, because of this property, it will be more stable.
Expand All @@ -1869,9 +1869,18 @@ class LassoLarsCV(LarsCV):
features are selected compared to the total number, for instance if
there are very few samples compared to the number of features.

See Also
Examples
--------
lars_path, LassoLars, LarsCV, LassoCV
>>> from sklearn.linear_model import LassoLarsCV
>>> from sklearn.datasets import make_regression
>>> X, y = make_regression(noise=4.0, random_state=0)
>>> reg = LassoLarsCV(cv=5, normalize=False).fit(X, y)
>>> reg.score(X, y)
0.9993...
>>> reg.alpha_
0.3972...
>>> reg.predict(X[:1,])
array([-78.4831...])
"""

method = "lasso"
Expand Down