you should use 

ir = IsotonicRegression(y_min=2, y_max=4)