Skip to content

DOC Ensures that MultiTaskElasticNetCV passes numpydoc validation #21405

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 23, 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 @@ -13,7 +13,6 @@

# List of modules ignored when checking for numpydoc validation.
DOCSTRING_IGNORE_LIST = [
"MultiTaskElasticNetCV",
"SpectralCoclustering",
"SpectralEmbedding",
"StackingRegressor",
Expand Down
35 changes: 19 additions & 16 deletions sklearn/linear_model/_coordinate_descent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2647,7 +2647,7 @@ class MultiTaskElasticNetCV(RegressorMixin, LinearModelCV):
prediction score is used. Note that a good choice of list of
values for l1_ratio is often to put more values close to 1
(i.e. Lasso) and less close to 0 (i.e. Ridge), as in ``[.1, .5, .7,
.9, .95, .99, 1]``
.9, .95, .99, 1]``.

eps : float, default=1e-3
Length of the path. ``eps=1e-3`` means that
Expand Down Expand Up @@ -2768,6 +2768,21 @@ class MultiTaskElasticNetCV(RegressorMixin, LinearModelCV):

.. versionadded:: 1.0

See Also
--------
MultiTaskElasticNet : Multi-task L1/L2 ElasticNet with built-in cross-validation.
ElasticNetCV : Elastic net model with best model selection by
cross-validation.
MultiTaskLassoCV : Multi-task Lasso model trained with L1/L2
mixed-norm as regularizer.

Notes
-----
The algorithm used to fit the model is coordinate descent.

To avoid unnecessary memory duplication the X and y arguments of the fit
method should be directly passed as Fortran-contiguous numpy arrays.

Examples
--------
>>> from sklearn import linear_model
Expand All @@ -2780,19 +2795,6 @@ class MultiTaskElasticNetCV(RegressorMixin, LinearModelCV):
[0.52875032 0.46958558]]
>>> print(clf.intercept_)
[0.00166409 0.00166409]

See Also
--------
MultiTaskElasticNet
ElasticNetCV
MultiTaskLassoCV

Notes
-----
The algorithm used to fit the model is coordinate descent.

To avoid unnecessary memory duplication the X and y arguments of the fit
method should be directly passed as Fortran-contiguous numpy arrays.
"""

path = staticmethod(enet_path)
Expand Down Expand Up @@ -2849,13 +2851,14 @@ def fit(self, X, y):
Parameters
----------
X : ndarray of shape (n_samples, n_features)
Data
Training data.
y : ndarray of shape (n_samples, n_targets)
Target. Will be cast to X's dtype if necessary
Training target variable. Will be cast to X's dtype if necessary.

Returns
-------
self : object
Returns MultiTaskElasticNet instance.
"""
return super().fit(X, y)

Expand Down