1.15. Isotonic regression#

The class IsotonicRegression fits a non-decreasing real function to 1-dimensional data. It solves the following problem:

miniwi(yiy^i)2

subject to y^iy^j whenever XiXj, where the weights wi are strictly positive, and both X and y are arbitrary real quantities.

The increasing parameter changes the constraint to y^iy^j whenever XiXj. Setting it to ‘auto’ will automatically choose the constraint based on Spearman’s rank correlation coefficient.

IsotonicRegression produces a series of predictions y^i for the training data which are the closest to the targets y in terms of mean squared error. These predictions are interpolated for predicting to unseen data. The predictions of IsotonicRegression thus form a function that is piecewise linear:

../_images/sphx_glr_plot_isotonic_regression_001.png

Examples