8000 add **fit_params to sklearn.compose.ColumnTransformer().fit() · Issue #24490 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

add **fit_params to sklearn.compose.ColumnTransformer().fit() #24490

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

Closed
cgahr opened this issue Sep 21, 2022 · 1 comment · Fixed by #27005
Closed

add **fit_params to sklearn.compose.ColumnTransformer().fit() #24490

cgahr opened this issue Sep 21, 2022 · 1 comment · Fixed by #27005

Comments

@cgahr
Copy link
cgahr commented Sep 21, 2022

Describe the workflow you want to enable

The fit function of both sklearn.pipeline.Pipeline and sklearn.pipeline.FeatureUnion supports **fit_params:

def fit(X, y=None, **fit_params):
    ...

Citing the documentation:

`**fit_params : dict of string -> object
Parameters passed to the fit method of each step, where each parameter name is prefixed such that parameter p for step s has key s__p.

Conversely, sklearn.compose.ColumnTransformer does not support fit_params:

def fit(X, y=None):
    ...

As far as I'm aware, it is therefore not possible to pass fit parameters to the individual column transforms.

Describe your proposed solution

The fit function of sklearn.compose.ColumnTransformer should support fit_params, using the same logic as sklearn.pipeline.Pipeline:

def fit(X, y=None, **fit_params):
    ...

Describe alternatives you've considered, if relevant

No response

Additional context

No response

@adrinjalali
Copy link
Member

#24027 fixes this.

9C77

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

Successfully merging a pull request may close this issue.

3 participants
0