Skip to content

Found a case where isotonic regression takes non-polynomial time #8063

Closed
@neggert

Description

@neggert

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:

iso_problem

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ModerateAnything that requires some knowledge of conventions and best practiceshelp wantedmodule:isotonic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions