Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.isotonic`.isotonic_regression

sklearn.isotonic.isotonic_regression(y, *, sample_weight=None, y_min=None, y_max=None, increasing=True)

  Solve the isotonic regression model.

  Read more in the User Guide.

  Parameters:
    y array-like of shape (n_samples,)

      The data.

    sample_weight array-like of shape (n_samples,), default=None

      Weights on each point of the regression. If None, weight is set to 1 (equal weights).

    y_min float, default=None

      Lower bound on the lowest predicted value (the minimum value may still be higher). If not set, defaults to -inf.

    y_max float, default=None

      Upper bound on the highest predicted value (the maximum may still be lower). If not set, defaults to +inf.

    increasing bool, default=True

      Whether to compute `y_` is increasing (if set to True) or decreasing (if set to False).

  Returns:
    y_ndarray of shape (n_samples,)

      Isotonic fit of y.

  References

  “Active set algorithms for isotonic regression; A unifying framework” by Michael J. Best and Nilotpal Chakravarti, section 3.