Skip to content

FIX Do not reset for non-fit in multiclass #20205

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

Merged

Conversation

thomasjpfan
Copy link
Member

Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I changed the validation scheme twice and copy pasted too quickly for the last version :/

@jeremiedbb
Copy link
Member

jeremiedbb commented Jun 3, 2021

Actually it seems to break something. Let's validate properly:
self._validate_data(X, force_all_finite=False, dtype=None, ensure_2d=False, reset=True|False)
I tested locally and it seems enough

@thomasjpfan
Copy link
Member Author

Actually it seems to break something. Let's validate properly: self._validate_data(X, force_all_finite=False, dtype=None, ensure_2d=False, reset=True|False) I tested locally and it seems enough

This can create a new numpy array when X is a list and _ConstantPredictor does not actually use the values of X.

Thinking through the test such as check_fit2d_predict1d with meta-estimators: we are not validating in the meta-estimator and delegating to the inner estimator. This means we can not expect check_fit2d_predict1d to pass for meta-estimators where the inner estimator does not validate.

@thomasjpfan
Copy link
Member Author

On a related note, I have been seeing the CI failing which is related related to the issue when the inner estimator is not validating. In that case test_estimators[OutputCodeClassifier(estimator=LogisticRegression(C=1))-check_complex_data] is failing.

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but don't we need a dedicated non-regression test for this?

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approved this PR without realizing that there were newly introduced broken tests :(

@glemaitre glemaitre merged commit 007da8d into scikit-learn:main Jun 9, 2021
@glemaitre
Copy link
Member

Thanks @thomasjpfan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants