Skip to content

Commit dcbddc7

Browse files
committed
DOC : fix move of isotonic in doc + examples
1 parent 23ac37a commit dcbddc7

File tree

5 files changed

+50
-22
lines changed

5 files changed

+50
-22
lines changed

doc/modules/classes.rst

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,30 @@ From text
434434
hmm.MultinomialHMM
435435
hmm.GMMHMM
436436

437+
.. _isotonic_ref:
438+
439+
:mod:`sklearn.isotonic`: Isotonic regression
440+
============================================
441+
442+
.. automodule:: sklearn.isotonic
443+
:no-members:
444+
:no-inherited-members:
445+
446+
**User guide:** See the :ref:`isotonic` section for further details.
447+
448+
.. currentmodule:: sklearn
449+
450+
.. autosummary::
451+
:toctree: generated/
452+
:template: class.rst
453+
454+
isotonic.IsotonicRegression
455+
456+
.. autosummary::
457+
:toctree: generated
458+
:template: function.rst
459+
460+
isotonic.isotonic_regression
437461

438462
.. _kernel_approximation_ref:
439463

@@ -515,7 +539,6 @@ From text
515539
linear_model.BayesianRidge
516540
linear_model.ElasticNet
517541
linear_model.ElasticNetCV
518-
linear_model.IsotonicRegression
519542
linear_model.Lars
520543
linear_model.LarsCV
521544
linear_model.Lasso
@@ -544,7 +567,6 @@ From text
544567
:toctree: generated/
545568
:template: function.rst
546569

547-
linear_model.isotonic_regression
548570
linear_model.lars_path
549571
linear_model.lasso_path
550572
linear_model.lasso_stability_path

doc/modules/isotonic.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.. _isotonic:
2+
3+
===================
4+
Isotonic regression
5+
===================
6+
7+
.. currentmodule:: sklearn.isotonic
8+
9+
The :class:`IsotonicRegression` fits a non-decreasing function to the data.
10+
It solves the following problem:
11+
12+
minimize :math:`\sum_i w_i (y_i - \hat{y}_i)^2`
13+
14+
subject to :math:`\hat{y}_{min} = \hat{y}_1 \le \hat{y}_2 ... \le \hat{y}_n = \hat{y}_{max}`
15+
16+
where each :math:`w_i` is strictly positive and each :math:`y_i` is an
17+
arbitrary real number. It yields the vector which is composed of non-decreasing
18+
elements the closest in terms of mean squared error. In practice this list
19+
of elements forms a function that is piecewise linear.
20+
21+
.. figure:: ../auto_examples/linear_model/images/plot_isotonic_regression_1.png
22+
:target: ../auto_examples/linear_model/images/plot_isotonic_regression.html
23+
:align: center

doc/modules/linear_model.rst

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -657,25 +657,6 @@ zero) model.
657657
thus be used to perform feature selection, as detailed in
658658
:ref:`l1_feature_selection`.
659659

660-
Isotonic regression
661-
====================
662-
663-
The :class:`IsotonicRegression` fits a non-decreasing function to the data.
664-
It solves the following problem:
665-
666-
minimize :math:`\sum_i w_i (y_i - \hat{y}_i)^2`
667-
668-
subject to :math:`\hat{y}_{min} = \hat{y}_1 \le \hat{y}_2 ... \le \hat{y}_n = \hat{y}_{max}`
669-
670-
where each :math:`w_i` is strictly positive and each :math:`y_i` is an
671-
arbitrary real number. It yields the vector which is composed of non-decreasing
672-
elements the closest in terms of mean squared error. In practice this list
673-
of elements forms a function that is piecewise linear.
674-
675-
.. figure:: ../auto_examples/linear_model/images/plot_isotonic_regression_1.png
676-
:target: ../auto_examples/linear_model/images/plot_isotonic_regression.html
677-
:align: center
678-
679660
Stochastic Gradient Descent - SGD
680661
=================================
681662

doc/supervised_learning.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ Supervised learning
2020
modules/feature_selection.rst
2121
modules/label_propagation.rst
2222
modules/lda_qda.rst
23+
modules/isotonic.rst

examples/linear_model/plot_isotonic_regression.py renamed to examples/plot_isotonic_regression.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
import pylab as pl
2121
from matplotlib.collections import LineCollection
2222

23-
from sklearn.linear_model import IsotonicRegression, LinearRegression
23+
from sklearn.linear_model import LinearRegression
24+
from sklearn.isotonic import IsotonicRegression
2425
from sklearn.utils import check_random_state
2526

2627
n = 100

0 commit comments

Comments
 (0)