Skip to content

Commit

Permalink
DEBUG print
Browse files Browse the repository at this point in the history
  • Loading branch information
lorentzenchr committed May 10, 2024
1 parent 4ca6e8b commit 3e903c3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sklearn/isotonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,18 @@ def isotonic_regression(
"""
y = check_array(y, ensure_2d=False, input_name="y", dtype=[np.float64, np.float32])
if sp_base_version >= parse_version("1.12.0"):
do_print = y.shape == (7,) and np.allclose(
y, np.array([10, 9, 10, 7, 6, 6.1, 5])
)
if do_print:
print("DEBUG INFO:")
print(f"{increasing=} {sample_weight=}\n{y=}")
res = optimize.isotonic_regression(
y=y, weights=sample_weight, increasing=increasing
)
y = np.asarray(res.x, dtype=y.dtype)
if do_print:
print(f"After isotonic_regression:\n{y=}")
else:
# TODO: remove this branch when Scipy 1.12 is the minimum supported version
# Also remove _inplace_contiguous_isotonic_regression.
Expand Down

0 comments on commit 3e903c3

Please sign in to comment.