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

if y is bool convert it into numerical #431

Merged
merged 3 commits into from
Dec 3, 2023

Conversation

mausam3407
Copy link
Contributor

@mausam3407 mausam3407 commented Nov 21, 2023

Fixes #

Proposed Changes

We're converting the y to float in _transform function but not in fit function. And for other transforms as well, if we're required to do numerical calculation on y, we first convert it to float. This PR is to maintain the consitency in behaviour

@PaulWestenthanner
Copy link
Collaborator

Thanks for pointing this out.
It would be better to change this in utils.convert_inputs as this is desired for all encoders.
Currently quantile encoder, leave one out encoder implement it on their own, whereas the others are missing it.
Do you mind moving this change to the utils?

Remove converting to float in catboost
@mausam3407
Copy link
Contributor Author

Hi @PaulWestenthanner
I thought instead of force converting y to float type. It'd be better to use label encoder incase of classification problems. I have made the change for same in base_class. Please take a look.

@PaulWestenthanner
Copy link
Collaborator

nice idea, LGTM & merging

@PaulWestenthanner PaulWestenthanner merged commit 3d588f6 into scikit-learn-contrib:master Dec 3, 2023
5 checks passed
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.

None yet

2 participants