Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsotonicRegression with 2D input and n_features=1 #15012

Closed
rth opened this issue Sep 18, 2019 · 7 comments · Fixed by #17379
Closed

IsotonicRegression with 2D input and n_features=1 #15012

rth opened this issue Sep 18, 2019 · 7 comments · Fixed by #17379
Assignees
Labels
API Easy Well-defined and straightforward way to resolve

Comments

@rth
Copy link
Member

rth commented Sep 18, 2019

IsotonicRegression works only on 1D data, however I think it should not fail when provided a 2D input with n_features=1.

Example

In other words the following example (from the docstring) should work without having to flatten X,

    >>> from sklearn.datasets import make_regression
    >>> from sklearn.isotonic import IsotonicRegression
    >>> X, y = make_regression(n_samples=10, n_features=1, random_state=41)
    >>> iso_reg = IsotonicRegression().fit(X.flatten(), y)
@rth
Copy link
Member Author

rth commented Sep 18, 2019

BTW IsotonicRegression is currently the only estimator that has {'X_types': ['1darray']} estimator tags, where 1darray is never used in common tests, so they check nothing I imagine.

Though supporting 2darray with only n_features=1 in common tests might also be non trivial.

@amueller
Copy link
Member

Right now any X_types that's not 2darray basically amounts to a "skip".
There's a PR somewhere with enforce_estimator_tags_X that ideally would enforce this tag.

@amueller
Copy link
Member

#14705

@jnothman
Copy link
Member

Unless there are obvious downsides we should probably make this change for consistency, allowing isotonic to take a column vector.

@jnothman jnothman added Easy Well-defined and straightforward way to resolve help wanted labels May 25, 2020
@amueller
Copy link
Member

Agreed

@fujiaxiang
Copy link
Contributor

Hi, can I work on this?

@fujiaxiang
Copy link
Contributor

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Easy Well-defined and straightforward way to resolve
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants