Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8971a19

Browse files
spikebhogriselglemaitre
committed
DOC Ensures that MultiTaskElasticNetCV passes numpydoc validation (#21405)
Co-authored-by: Olivier Grisel <[email protected]> Co-authored-by: Guillaume Lemaitre <[email protected]>
1 parent d6e24ee commit 8971a19

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

maint_tools/test_docstrings.py

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
# List of modules ignored when checking for numpydoc validation.
1111
DOCSTRING_IGNORE_LIST = [
12-
"MultiTaskElasticNetCV",
1312
"SpectralCoclustering",
1413
"SpectralEmbedding",
1514
"StackingRegressor",

sklearn/linear_model/_coordinate_descent.py

+19-16
Original file line numberDiff line numberDiff line change
@@ -2647,7 +2647,7 @@ class MultiTaskElasticNetCV(RegressorMixin, LinearModelCV):
26472647
prediction score is used. Note that a good choice of list of
26482648
values for l1_ratio is often to put more values close to 1
26492649
(i.e. Lasso) and less close to 0 (i.e. Ridge), as in ``[.1, .5, .7,
2650-
.9, .95, .99, 1]``
2650+
.9, .95, .99, 1]``.
26512651
26522652
eps : float, default=1e-3
26532653
Length of the path. ``eps=1e-3`` means that
@@ -2768,6 +2768,21 @@ class MultiTaskElasticNetCV(RegressorMixin, LinearModelCV):
27682768
27692769
.. versionadded:: 1.0
27702770
2771+
See Also
2772+
--------
2773+
MultiTaskElasticNet : Multi-task L1/L2 ElasticNet with built-in cross-validation.
2774+
ElasticNetCV : Elastic net model with best model selection by
2775+
cross-validation.
2776+
MultiTaskLassoCV : Multi-task Lasso model trained with L1/L2
2777+
mixed-norm as regularizer.
2778+
2779+
Notes
2780+
-----
2781+
The algorithm used to fit the model is coordinate descent.
2782+
2783+
To avoid unnecessary memory duplication the X and y arguments of the fit
2784+
method should be directly passed as Fortran-contiguous numpy arrays.
2785+
27712786
Examples
27722787
--------
27732788
>>> from sklearn import linear_model
@@ -2780,19 +2795,6 @@ class MultiTaskElasticNetCV(RegressorMixin, LinearModelCV):
27802795
[0.52875032 0.46958558]]
27812796
>>> print(clf.intercept_)
27822797
[0.00166409 0.00166409]
2783-
2784-
See Also
2785-
--------
2786-
MultiTaskElasticNet
2787-
ElasticNetCV
2788-
MultiTaskLassoCV
2789-
2790-
Notes
2791-
-----
2792-
The algorithm used to fit the model is coordinate descent.
2793-
2794-
To avoid unnecessary memory duplication the X and y arguments of the fit
2795-
method should be directly passed as Fortran-contiguous numpy arrays.
27962798
"""
27972799

27982800
path = staticmethod(enet_path)
@@ -2849,13 +2851,14 @@ def fit(self, X, y):
28492851
Parameters
28502852
----------
28512853
X : ndarray of shape (n_samples, n_features)
2852-
Data
2854+
Training data.
28532855
y : ndarray of shape (n_samples, n_targets)
2854-
Target. Will be cast to X's dtype if necessary
2856+
Training target variable. Will be cast to X's dtype if necessary.
28552857
28562858
Returns
28572859
-------
28582860
self : object
2861+
Returns MultiTaskElasticNet instance.
28592862
"""
28602863
return super().fit(X, y)
28612864

0 commit comments

Comments
 (0)