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

[FEA] Support feature_names_in_ attribute #5677

Open
tvdboom opened this issue Nov 29, 2023 · 2 comments · May be fixed by #5678
Open

[FEA] Support feature_names_in_ attribute #5677

tvdboom opened this issue Nov 29, 2023 · 2 comments · May be fixed by #5678
Labels
? - Needs Triage Need team to review and classify feature request New feature or request

Comments

@tvdboom
Copy link

tvdboom commented Nov 29, 2023

Is your feature request related to a problem? Please describe.
To be able to use cuml estimators as a sklearn drop-in replacement, they should have the same attributes. One often used in pipelines is feature_names_in_, that contains the names of the features seen during fit (when provided in a pd.dataframe or cupy.dataframe)

Describe the solution you'd like
Support for all cuml estimators to have the feature_names_in_ attribute after fit. Currently, only n_features_in_ is supported.

from sklearn.datasets import load_breast_cancer
from cuml.preprocessing import StandardScaler

X, _ = load_breast_cancer(return_X_y=True, as_frame=True)

scaler = StandardScaler().fit(X)
print(scaler.n_features_in_)  # Works
print(scaler.feature_names_in_)  # AttributeError

Implementing this could potentially help with #5564

@tvdboom tvdboom added ? - Needs Triage Need team to review and classify feature request New feature or request labels Nov 29, 2023
@tvdboom tvdboom linked a pull request Nov 29, 2023 that will close this issue
@jinsolp
Copy link
Contributor

jinsolp commented May 21, 2024

Hello! Would you like to move forward with this issue? Or will it be okay if I start working on the feature?

@tvdboom
Copy link
Author

tvdboom commented May 22, 2024

Feel free to work on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
? - Needs Triage Need team to review and classify feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants