Closed
Description
I discovered an edge case in the new Isotonic Regression algorithm introduced in #7444 that causes it to take non-polynomial time.
To reproduce, add a case to bench_isotonic.py
:
def generate_alternating_dataset(size):
x = np.asarray([yi if i % 2 == 0 else yi - 1.5
for (i, yi) in enumerate(np.arange(size, 0, -1))])
return x
I get this:
I suspect what happening is that it backtracks all the way to the beginning at each iteration. There's a similar problem in the Spark implementation that I'm working on over in apache/spark#15018.