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

Sklearn compatible multi feature transformer #343

Open
lcrmorin opened this issue Dec 11, 2024 · 3 comments
Open

Sklearn compatible multi feature transformer #343

lcrmorin opened this issue Dec 11, 2024 · 3 comments

Comments

@lcrmorin
Copy link

I have found myself in a position to need a practical way to apply binning + WoE encoding on all features of a dataset. As I was not able to find the solution within the package I have implemented a custom sklearn compatible version myself. Typically it works as follows:

OBT = OptBinningTransformer()
X_WoE = OBT.fit_transform(X, y)

I have made some effort to comment / sanitise / make it customisable / handle types / define some tests. Would it be a good idea to integrate this ? Where ?

@bmreiniger
Copy link
Contributor

Doesn't BinningProcess do this, since the default transform method for a binary classification is WoE?

@lcrmorin
Copy link
Author

It seems to be working after inputing column names... I somehow confused it with something else.
Still a bit weird to have to specify column names.

@bmreiniger
Copy link
Contributor

Oh, yes, I would advocate for maybe defaulting the list of columns to None which then applies to all columns (using names if pandas and x{i} for i in range(m) else).

(I also have a thin wrapper in my company's packaging for this sort of thing. I think I recall the priority of the transform metric specifications (in constructor and in transform) seemed backwards from what I'd expect too?)

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

No branches or pull requests

2 participants