Skip to content

Commit a7aed50

Browse files
committed
DOC: formatting and rephrasing in MultiTaskLasso
1 parent dab7dcf commit a7aed50

File tree

2 files changed

+32
-21
lines changed

2 files changed

+32
-21
lines changed

doc/modules/linear_model.rst

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,13 @@ observations, it is often faster than :class:`LassoCV`.
225225

226226
.. |lasso_cv_1| image:: ../auto_examples/linear_model/images/plot_lasso_model_selection_2.png
227227
:target: ../auto_examples/linear_model/plot_lasso_model_selection.html
228-
:scale: 50%
228+
:scale: 48%
229229

230230
.. |lasso_cv_2| image:: ../auto_examples/linear_model/images/plot_lasso_model_selection_3.png
231231
:target: ../auto_examples/linear_model/plot_lasso_model_selection.html
232-
:scale: 50%
232+
:scale: 48%
233233

234-
|lasso_cv_1| |lasso_cv_2|
234+
.. centered:: |lasso_cv_1| |lasso_cv_2|
235235

236236

237237
Information-criteria based model selection
@@ -291,10 +291,34 @@ and `rho` by cross-validation.
291291
Multi-task Lasso
292292
================
293293

294-
The :class:`MultiTaskLasso` is a linear model that estimates sparse coefficients
295-
for multiple regression problems jointly. The constraint is that the selected
294+
The :class:`MultiTaskLasso` is a linear model that estimates sparse
295+
coefficients for multiple regression problems jointly: `y` is a 2D array,
296+
of shape (n_samples, n_tasks). The constraint is that the selected
296297
features are the same for all the regression problems, also called tasks.
297298

299+
The following figure compares the location of the non-zeros in W obtained
300+
with a simple Lasso or a MultiTaskLasso. The Lasso estimates yields
301+
scattered non-zeros while the non-zeros of the MultiTaskLasso are full
302+
columns.
303+
304+
.. |multi_task_lasso_1| image:: ../auto_examples/linear_model/images/plot_multi_task_lasso_support_1.png
305+
:target: ../auto_examples/linear_model/plot_multi_task_lasso_support.html
306+
:scale: 48%
307+
308+
.. |multi_task_lasso_2| image:: ../auto_examples/linear_model/images/plot_multi_task_lasso_support_2.png
309+
:target: ../auto_examples/linear_model/plot_multi_task_lasso_support.html
310+
:scale: 48%
311+
312+
.. centered:: |multi_task_lasso_1| |multi_task_lasso_2|
313+
314+
.. centered:: Fitting a time-series model, imposing that any active feature be active at all times.
315+
316+
.. topic:: Examples:
317+
318+
* :ref:`example_linear_model_plot_multi_task_lasso_support.py`
319+
320+
321+
298322
Mathematically, it consists of a linear model trained with a mixed
299323
:math:`\ell_1` :math:`\ell_2` prior as regularizer.
300324
The objective function to minimize is:
@@ -309,21 +333,6 @@ where;
309333
The implementation in the class :class:`MultiTaskLasso` uses coordinate descent as
310334
the algorithm to fit the coefficients.
311335

312-
The following figure compares the location of the non-zeros in W obtained with
313-
a simple Lasso or a MultiTaskLasso. The Lasso estimates yields scattered non-zeros
314-
while the non-zeros of the MultiTaskLasso are full columns.
315-
316-
.. |multi_task_lasso_1| image:: ../auto_examples/linear_model/images/plot_multi_task_lasso_support_1.png
317-
:target: ../auto_examples/linear_model/plot_multi_task_lasso_support.html
318-
:scale: 50%
319-
320-
|multi_task_lasso_1|
321-
322-
.. topic:: Examples:
323-
324-
* :ref:`example_linear_model_plot_multi_task_lasso_support.py`
325-
326-
327336
.. _least_angle_regression:
328337

329338
Least Angle Regression

examples/linear_model/plot_multi_task_lasso_support.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
jointly enforcing the selected features to be the same accross
99
tasks. This example simulates sequential measurements, each task
1010
is a time instant, and the relevant features vary in amplitude
11-
over time while being the same.
11+
over time while being the same. The multi-task lasso imposes that
12+
features that are selected at one time point are select for all time
13+
point. This makes feature selection by the Lasso more stable.
1214
1315
"""
1416
print __doc__

0 commit comments

Comments
 (0)