Skip to content

FIX Removes warning in HGBT when fitting on dataframes #22908

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

Conversation

thomasjpfan
Copy link
Member

Reference Issues/PRs

Fixes #22907

What does this implement/fix? Explain your changes.

This PR removes the validation when _in_fit is True. If HistGradientBoosting* is in fit, then the binned data was generated by HistGradientBoosting* itself in the bin mapper and does not require more validation.

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.

LGTM

Comment on lines +939 to +942
if not is_binned:
X = self._validate_data(
X, dtype=X_DTYPE, force_all_finite=False, reset=False
)
Copy link
Member

Choose a reason for hiding this comment

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

I'm surprised that we have validation in this private method. Imo in the long term we should move the validation to the public methods but let's keep it that way in this PR

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

LGTM

@glemaitre glemaitre merged commit 4408dfb into scikit-learn:main Mar 25, 2022
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UserWarning is thrown when calling HistGradientBoostingRegressor.fit while specifying scoring argument
3 participants