8000 DOC Ensures that MultiTaskElasticNet passes numpydoc validation (#21381) · scikit-learn/scikit-learn@5187554 · GitHub
[go: up one dir, main page]

Skip to content {"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}

Commit 5187554

Browse files
spikebhglemaitre
andauthored
DOC Ensures that MultiTaskElasticNet passes numpydoc validation (#21381)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
1 parent 80dc575 commit 5187554

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

maint_tools/test_docstrings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"LabelPropagation",
1818
"LabelSpreading",
1919
"LocallyLinearEmbedding",
20-
"MultiTaskElasticNet",
2120
"MultiTaskElasticNetCV",
2221
"MultiTaskLassoCV",
2322
"OrthogonalMatchingPursuitCV",

sklearn/linear_model/_coordinate_descent.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,8 +2204,7 @@ def _more_tags(self):
22042204

22052205

22062206
class MultiTaskElasticNet(Lasso):
2207-
"""Multi-task ElasticNet model trained with L1/L2 mixed-norm as
2208-
regularizer.
2207+
"""Multi-task ElasticNet model trained with L1/L2 mixed-norm as regularizer.
22092208
22102209
The optimization objective for MultiTaskElasticNet is::
22112210
@@ -2313,31 +2312,31 @@ class MultiTaskElasticNet(Lasso):
23132312
23142313
.. versionadded:: 1.0
23152314
2316-
Examples
2317-
--------
2318-
>>> from sklearn import linear_model
2319-
>>> clf = linear_model.MultiTaskElasticNet(alpha=0.1)
2320-
>>> clf.fit([[0,0], [1, 1], [2, 2]], [[0, 0], [1, 1], [2, 2]])
2321-
MultiTaskElasticNet(alpha=0.1)
2322-
>>> print(clf.coef_)
2323-
[[0.45663524 0.45612256]
2324-
[0.45663524 0.45612256]]
2325-
>>> print(clf.intercept_)
2326-
[0.0872422 0.0872422]
2327-
23282315
See Also
23292316
--------
23302317
MultiTaskElasticNetCV : Multi-task L1/L2 ElasticNet with built-in
23312318
cross-validation.
2332-
ElasticNet
2333-
MultiTaskLasso
2319+
ElasticNet : Linear regression with combined L1 and L2 priors as regularizer.
2320+
MultiTaskLasso : Multi-task L1/L2 Lasso with built-in cross-validation.
23342321
23352322
Notes
23362323
-----
23372324
The algorithm used to fit the model is coordinate descent.
23382325
23392326
To avoid unnecessary memory duplication the X and y arguments of the fit
23402327
method should be directly passed as Fortran-contiguous numpy arrays.
2328+
2329+
Examples
2330+
--------
2331+
>>> from sklearn import linear_model
2332+
>>> clf = linear_model.MultiTaskElasticNet(alpha=0.1)
2333+
>>> clf.fit([[0,0], [1, 1], [2, 2]], [[0, 0], [1, 1], [2, 2]])
2334+
MultiTaskElasticNet(alpha=0.1)
2335+
>>> print(clf.coef_)
2336+
[[0.45663524 0.45612256]
2337+
[0.45663524 0.45612256]]
2338+
>>> print(clf.intercept_)
2339+
[0.0872422 0.0872422]
23412340
"""
23422341

23432342
def __init__(

0 commit comments

Comments
 (0)
0