Skip to content

Commit 7abdd86

Browse files
committed
Rebuild dev docs at master=93c3033
1 parent 38fb67f commit 7abdd86

File tree

231 files changed

+1588
-1534
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+1588
-1534
lines changed
918 Bytes
Loading
1.21 KB
Loading
896 Bytes
Loading
1.62 KB
Loading
294 Bytes
Loading

dev/_sources/modules/linear_model.txt

Lines changed: 67 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,58 @@ They also tend to break when the problem is badly conditioned
266266

267267
* :ref:`example_linear_model_plot_lasso_model_selection.py`
268268

269+
270+
.. _multi_task_lasso:
271+
272+
Multi-task Lasso
273+
================
274+
275+
The :class:`MultiTaskLasso` is a linear model that estimates sparse
276+
coefficients for multiple regression problems jointly: ``y`` is a 2D array,
277+
of shape ``(n_samples, n_tasks)``. The constraint is that the selected
278+
features are the same for all the regression problems, also called tasks.
279+
280+
The following figure compares the ___location of the non-zeros in W obtained
281+
with a simple Lasso or a MultiTaskLasso. The Lasso estimates yields
282+
scattered non-zeros while the non-zeros of the MultiTaskLasso are full
283+
columns.
284+
285+
.. |multi_task_lasso_1| image:: ../auto_examples/linear_model/images/plot_multi_task_lasso_support_001.png
286+
:target: ../auto_examples/linear_model/plot_multi_task_lasso_support.html
287+
:scale: 48%
288+
289+
.. |multi_task_lasso_2| image:: ../auto_examples/linear_model/images/plot_multi_task_lasso_support_002.png
290+
:target: ../auto_examples/linear_model/plot_multi_task_lasso_support.html
291+
:scale: 48%
292+
293+
.. centered:: |multi_task_lasso_1| |multi_task_lasso_2|
294+
295+
.. centered:: Fitting a time-series model, imposing that any active feature be active at all times.
296+
297+
.. topic:: Examples:
298+
299+
* :ref:`example_linear_model_plot_multi_task_lasso_support.py`
300+
301+
302+
Mathematically, it consists of a linear model trained with a mixed
303+
:math:`\ell_1` :math:`\ell_2` prior as regularizer.
304+
The objective function to minimize is:
305+
306+
.. math:: \underset{w}{min\,} { \frac{1}{2n_{samples}} ||X W - Y||_{Fro} ^ 2 + \alpha ||W||_{21}}
307+
308+
where :math:`Fro` indicates the Frobenius norm:
309+
310+
.. math:: ||A||_{Fro} = \sqrt{\sum_{ij} a_{ij}^2}
311+
312+
and :math:`\ell_1` :math:`\ell_2` reads:
313+
314+
.. math:: ||A||_{2 1} = \sum_i \sqrt{\sum_j a_{ij}^2}
315+
316+
317+
The implementation in the class :class:`MultiTaskLasso` uses coordinate descent as
318+
the algorithm to fit the coefficients.
319+
320+
269321
.. _elastic_net:
270322

271323
Elastic Net
@@ -305,52 +357,32 @@ The class :class:`ElasticNetCV` can be used to set the parameters
305357
* :ref:`example_linear_model_plot_lasso_coordinate_descent_path.py`
306358

307359

308-
.. _multi_task_lasso:
309360

310-
Multi-task Lasso
311-
================
312-
313-
The :class:`MultiTaskLasso` is a linear model that estimates sparse
314-
coefficients for multiple regression problems jointly: ``y`` is a 2D array,
315-
of shape (n_samples, n_tasks). The constraint is that the selected
316-
features are the same for all the regression problems, also called tasks.
317-
318-
The following figure compares the ___location of the non-zeros in W obtained
319-
with a simple Lasso or a MultiTaskLasso. The Lasso estimates yields
320-
scattered non-zeros while the non-zeros of the MultiTaskLasso are full
321-
columns.
322-
323-
.. |multi_task_lasso_1| image:: ../auto_examples/linear_model/images/plot_multi_task_lasso_support_001.png
324-
:target: ../auto_examples/linear_model/plot_multi_task_lasso_support.html
325-
:scale: 48%
326-
327-
.. |multi_task_lasso_2| image:: ../auto_examples/linear_model/images/plot_multi_task_lasso_support_002.png
328-
:target: ../auto_examples/linear_model/plot_multi_task_lasso_support.html
329-
:scale: 48%
330-
331-
.. centered:: |multi_task_lasso_1| |multi_task_lasso_2|
332-
333-
.. centered:: Fitting a time-series model, imposing that any active feature be active at all times.
334-
335-
.. topic:: Examples:
336-
337-
* :ref:`example_linear_model_plot_multi_task_lasso_support.py`
361+
.. _multi_task_elastic_net:
338362

363+
Multi-task Elastic Net
364+
======================
339365

366+
The :class:`MultiTaskElasticNet` is an elastic-net model that estimates sparse
367+
coefficients for multiple regression problems jointly: ``Y`` is a 2D array,
368+
of shape ``(n_samples, n_tasks)``. The constraint is that the selected
369+
features are the same for all the regression problems, also called tasks.
340370

341371
Mathematically, it consists of a linear model trained with a mixed
342-
:math:`\ell_1` :math:`\ell_2` prior as regularizer.
372+
:math:`\ell_1` :math:`\ell_2` prior and :math:`\ell_2` prior as regularizer.
343373
The objective function to minimize is:
344374

345-
.. math:: \underset{w}{min\,} { \frac{1}{2n_{samples}} ||X W - Y||_2 ^ 2 + \alpha ||W||_{21}}
375+
.. math::
346376

347-
where;
377+
\underset{W}{min\,} { \frac{1}{2n_{samples}} ||X W - Y||_{Fro}^2 + \alpha \rho ||W||_{2 1} +
378+
\frac{\alpha(1-\rho)}{2} ||W||_{Fro}^2}
348379

349-
.. math:: ||W||_{2 1} = \sum_i \sqrt{\sum_j w_{ij}^2}
380+
The implementation in the class :class:`MultiTaskElasticNet` uses coordinate descent as
381+
the algorithm to fit the coefficients.
350382

383+
The class :class:`MultiTaskElasticNetCV` can be used to set the parameters
384+
``alpha`` (:math:`\alpha`) and ``l1_ratio`` (:math:`\rho`) by cross-validation.
351385

352-
The implementation in the class :class:`MultiTaskLasso` uses coordinate descent as
353-
the algorithm to fit the coefficients.
354386

355387
.. _least_angle_regression:
356388

dev/modules/generated/sklearn.base.BaseEstimator.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
<h1><a class="reference internal" href="../classes.html#module-sklearn.base" title="sklearn.base"><tt class="xref py py-mod docutils literal"><span class="pre">sklearn.base</span></tt></a>.BaseEstimator<a class="headerlink" href="#sklearn-base-baseestimator" title="Permalink to this headline"></a></h1>
173173
<dl class="class">
174174
<dt id="sklearn.base.BaseEstimator">
175-
<em class="property">class </em><tt class="descclassname">sklearn.base.</tt><tt class="descname">BaseEstimator</tt><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/8aa9c19/sklearn/base.py#L169"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.base.BaseEstimator" title="Permalink to this definition"></a></dt>
175+
<em class="property">class </em><tt class="descclassname">sklearn.base.</tt><tt class="descname">BaseEstimator</tt><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/93c3033/sklearn/base.py#L169"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.base.BaseEstimator" title="Permalink to this definition"></a></dt>
176176
<dd><p>Base class for all estimators in scikit-learn</p>
177177
<p class="rubric">Notes</p>
178178
<p>All estimators should specify all the parameters that can be set
@@ -201,7 +201,7 @@ <h1><a class="reference internal" href="../classes.html#module-sklearn.base" tit
201201

202202
<dl class="method">
203203
<dt id="sklearn.base.BaseEstimator.get_params">
204-
<tt class="descname">get_params</tt><big>(</big><em>deep=True</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/8aa9c19/sklearn/base.py#L206"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.base.BaseEstimator.get_params" title="Permalink to this definition"></a></dt>
204+
<tt class="descname">get_params</tt><big>(</big><em>deep=True</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/93c3033/sklearn/base.py#L206"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.base.BaseEstimator.get_params" title="Permalink to this definition"></a></dt>
205205
<dd><p>Get parameters for this estimator.</p>
206206
<table class="docutils field-list" frame="void" rules="none">
207207
<col class="field-name" />
@@ -226,7 +226,7 @@ <h1><a class="reference internal" href="../classes.html#module-sklearn.base" tit
226226

227227
<dl class="method">
228228
<dt id="sklearn.base.BaseEstimator.set_params">
229-
<tt class="descname">set_params</tt><big>(</big><em>**params</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/8aa9c19/sklearn/base.py#L243"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.base.BaseEstimator.set_params" title="Permalink to this definition"></a></dt>
229+
<tt class="descname">set_params</tt><big>(</big><em>**params</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/93c3033/sklearn/base.py#L243"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.base.BaseEstimator.set_params" title="Permalink to this definition"></a></dt>
230230
<dd><p>Set the parameters of this estimator.</p>
231231
<p>The method works on simple estimators as well as on nested objects
232232
(such as pipelines). The former have parameters of the form

dev/modules/generated/sklearn.base.TransformerMixin.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
<h1><a class="reference internal" href="../classes.html#module-sklearn.base" title="sklearn.base"><tt class="xref py py-mod docutils literal"><span class="pre">sklearn.base</span></tt></a>.TransformerMixin<a class="headerlink" href="#sklearn-base-transformermixin" title="Permalink to this headline"></a></h1>
173173
<dl class="class">
174174
<dt id="sklearn.base.TransformerMixin">
175-
<em class="property">class </em><tt class="descclassname">sklearn.base.</tt><tt class="descname">TransformerMixin</tt><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/8aa9c19/sklearn/base.py#L435"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.base.TransformerMixin" title="Permalink to this definition"></a></dt>
175+
<em class="property">class </em><tt class="descclassname">sklearn.base.</tt><tt class="descname">TransformerMixin</tt><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/93c3033/sklearn/base.py#L435"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.base.TransformerMixin" title="Permalink to this definition"></a></dt>
176176
<dd><p>Mixin class for all transformers in scikit-learn.</p>
177177
<p class="rubric">Methods</p>
178178
<table border="1" class="longtable docutils">
@@ -194,7 +194,7 @@ <h1><a class="reference internal" href="../classes.html#module-sklearn.base" tit
194194

195195
<dl class="method">
196196
<dt id="sklearn.base.TransformerMixin.fit_transform">
197-
<tt class="descname">fit_transform</tt><big>(</big><em>X</em>, <em>y=None</em>, <em>**fit_params</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/8aa9c19/sklearn/base.py#L438"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.base.TransformerMixin.fit_transform" title="Permalink to this definition"></a></dt>
197+
<tt class="descname">fit_transform</tt><big>(</big><em>X</em>, <em>y=None</em>, <em>**fit_params</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/93c3033/sklearn/base.py#L438"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.base.TransformerMixin.fit_transform" title="Permalink to this definition"></a></dt>
198198
<dd><p>Fit to data, then transform it.</p>
199199
<p>Fits transformer to X and y with optional parameters fit_params
200200
and returns a transformed version of X.</p>

dev/modules/generated/sklearn.calibration.CalibratedClassifierCV.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
<h1><a class="reference internal" href="../classes.html#module-sklearn.calibration" title="sklearn.calibration"><tt class="xref py py-mod docutils literal"><span class="pre">sklearn.calibration</span></tt></a>.CalibratedClassifierCV<a class="headerlink" href="#sklearn-calibration-calibratedclassifiercv" title="Permalink to this headline"></a></h1>
173173
<dl class="class">
174174
<dt id="sklearn.calibration.CalibratedClassifierCV">
175-
<em class="property">class </em><tt class="descclassname">sklearn.calibration.</tt><tt class="descname">CalibratedClassifierCV</tt><big>(</big><em>base_estimator=None</em>, <em>method='sigmoid'</em>, <em>cv=3</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/8aa9c19/sklearn/calibration.py#L29"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV" title="Permalink to this definition"></a></dt>
175+
<em class="property">class </em><tt class="descclassname">sklearn.calibration.</tt><tt class="descname">CalibratedClassifierCV</tt><big>(</big><em>base_estimator=None</em>, <em>method='sigmoid'</em>, <em>cv=3</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/93c3033/sklearn/calibration.py#L29"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV" title="Permalink to this definition"></a></dt>
176176
<dd><p>Probability calibration with isotonic regression or sigmoid.</p>
177177
<p>With this class, the base_estimator is fit on the train set of the
178178
cross-validation generator and the test set is used for calibration.
@@ -294,12 +294,12 @@ <h1><a class="reference internal" href="../classes.html#module-sklearn.calibrati
294294
</table>
295295
<dl class="method">
296296
<dt id="sklearn.calibration.CalibratedClassifierCV.__init__">
297-
<tt class="descname">__init__</tt><big>(</big><em>base_estimator=None</em>, <em>method='sigmoid'</em>, <em>cv=3</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/8aa9c19/sklearn/calibration.py#L98"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV.__init__" title="Permalink to this definition"></a></dt>
297+
<tt class="descname">__init__</tt><big>(</big><em>base_estimator=None</em>, <em>method='sigmoid'</em>, <em>cv=3</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/93c3033/sklearn/calibration.py#L98"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV.__init__" title="Permalink to this definition"></a></dt>
298298
<dd></dd></dl>
299299

300300
<dl class="method">
301301
<dt id="sklearn.calibration.CalibratedClassifierCV.fit">
302-
<tt class="descname">fit</tt><big>(</big><em>X</em>, <em>y</em>, <em>sample_weight=None</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/8aa9c19/sklearn/calibration.py#L103"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV.fit" title="Permalink to this definition"></a></dt>
302+
<tt class="descname">fit</tt><big>(</big><em>X</em>, <em>y</em>, <em>sample_weight=None</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/93c3033/sklearn/calibration.py#L103"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV.fit" title="Permalink to this definition"></a></dt>
303303
<dd><p>Fit the calibrated model</p>
304304
<table class="docutils field-list" frame="void" rules="none">
305305
<col class="field-name" />
@@ -331,7 +331,7 @@ <h1><a class="reference internal" href="../classes.html#module-sklearn.calibrati
331331

332332
<dl class="method">
333333
<dt id="sklearn.calibration.CalibratedClassifierCV.get_params">
334-
<tt class="descname">get_params</tt><big>(</big><em>deep=True</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/8aa9c19/sklearn/base.py#L206"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV.get_params" title="Permalink to this definition"></a></dt>
334+
<tt class="descname">get_params</tt><big>(</big><em>deep=True</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/93c3033/sklearn/base.py#L206"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV.get_params" title="Permalink to this definition"></a></dt>
335335
<dd><p>Get parameters for this estimator.</p>
336336
<table class="docutils field-list" frame="void" rules="none">
337337
<col class="field-name" />
@@ -356,7 +356,7 @@ <h1><a class="reference internal" href="../classes.html#module-sklearn.calibrati
356356

357357
<dl class="method">
358358
<dt id="sklearn.calibration.CalibratedClassifierCV.predict">
359-
<tt class="descname">predict</tt><big>(</big><em>X</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/8aa9c19/sklearn/calibration.py#L216"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV.predict" title="Permalink to this definition"></a></dt>
359+
<tt class="descname">predict</tt><big>(</big><em>X</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/93c3033/sklearn/calibration.py#L216"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV.predict" title="Permalink to this definition"></a></dt>
360360
<dd><p>Predict the target of new samples. Can be different from the
361361
prediction of the uncalibrated classifier.</p>
362362
<table class="docutils field-list" frame="void" rules="none">
@@ -381,7 +381,7 @@ <h1><a class="reference internal" href="../classes.html#module-sklearn.calibrati
381381

382382
<dl class="method">
383383
<dt id="sklearn.calibration.CalibratedClassifierCV.predict_proba">
384-
<tt class="descname">predict_proba</tt><big>(</big><em>X</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/8aa9c19/sklearn/calibration.py#L186"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV.predict_proba" title="Permalink to this definition"></a></dt>
384+
<tt class="descname">predict_proba</tt><big>(</big><em>X</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/93c3033/sklearn/calibration.py#L186"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV.predict_proba" title="Permalink to this definition"></a></dt>
385385
<dd><p>Posterior probabilities of classification</p>
386386
<p>This function returns posterior probabilities of classification
387387
according to each class on an array of test vectors X.</p>
@@ -407,7 +407,7 @@ <h1><a class="reference internal" href="../classes.html#module-sklearn.calibrati
407407

408408
<dl class="method">
409409
<dt id="sklearn.calibration.CalibratedClassifierCV.score">
410-
<tt class="descname">score</tt><big>(</big><em>X</em>, <em>y</em>, <em>sample_weight=None</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/8aa9c19/sklearn/base.py#L292"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV.score" title="Permalink to this definition"></a></dt>
410+
<tt class="descname">score</tt><big>(</big><em>X</em>, <em>y</em>, <em>sample_weight=None</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/93c3033/sklearn/base.py#L292"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV.score" title="Permalink to this definition"></a></dt>
411411
<dd><p>Returns the mean accuracy on the given test data and labels.</p>
412412
<p>In multi-label classification, this is the subset accuracy
413413
which is a harsh metric since you require for each sample that
@@ -442,7 +442,7 @@ <h1><a class="reference internal" href="../classes.html#module-sklearn.calibrati
442442

443443
<dl class="method">
444444
<dt id="sklearn.calibration.CalibratedClassifierCV.set_params">
445-
<tt class="descname">set_params</tt><big>(</big><em>**params</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/8aa9c19/sklearn/base.py#L243"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV.set_params" title="Permalink to this definition"></a></dt>
445+
<tt class="descname">set_params</tt><big>(</big><em>**params</em><big>)</big><a class="reference external" href="https://github.com/scikit-learn/scikit-learn/blob/93c3033/sklearn/base.py#L243"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#sklearn.calibration.CalibratedClassifierCV.set_params" title="Permalink to this definition"></a></dt>
446446
<dd><p>Set the parameters of this estimator.</p>
447447
<p>The method works on simple estimators as well as on nested objects
448448
(such as pipelines). The former have parameters of the form

0 commit comments

Comments
 (0)