Skip to content

Commit

Permalink
DOC Ensures that MultiTaskElasticNetCV passes numpydoc validation (#2…
Browse files Browse the repository at this point in the history
…1405)

Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
  • Loading branch information
3 people committed Oct 23, 2021
1 parent 8570a69 commit ef7a028
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
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

0 comments on commit ef7a028

Please sign in to comment.