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

fix: round when target is integer #6

Merged
merged 1 commit into from
Mar 30, 2024
Merged

fix: round when target is integer #6

merged 1 commit into from
Mar 30, 2024

Conversation

lsorber
Copy link
Member

@lsorber lsorber commented Mar 30, 2024

Before this PR:

  • Predictions are cast to the target dtype.
  • The target dtype is set to np.intp if the dtype was float but the values are integer (I don't agree with this, but it is required to satisfy sklearn's check_regressors_int check).

After this PR:

  • Predictions are rounded before casting to the target dtype (which may be np.intp even if the original dtype was float).

@lsorber lsorber self-assigned this Mar 30, 2024
@lsorber lsorber merged commit 700fb84 into main Mar 30, 2024
2 checks passed
@lsorber lsorber deleted the ls-target-type branch March 30, 2024 11:17
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.

1 participant