Skip to content

Isotonic regression doesn't not respect y_min and y_max arguments #6921

@NelleV

Description

@NelleV

Reported by Jonathan Taylor.

While trying to fit an isotonic regression with not trivial y_min and y_max, the fit returned a solution that does not fit the bounds:

import numpy as np
from sklearn import isotonic

X = np.array([1.26336413, 1.31853693, -0.57200917, 0.3072928, -0.70686507,
              -0.17614937, -1.59943059, 1.05908504, 1.3958263, 1.90580318,
              0.20992272, 0.02836316, -0.08092235, 0.44438247, 0.01791253,
              -0.3771914, -0.89577538, -0.37726249, -1.32687569, 0.18013201])

Y = isotonic.isotonic_regression(X, y_min=0, y_max=0.1)
assert(np.all(Y > 0))
assert(np.all(Y < 0.1))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions