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

How to recursive remove features by best loss ? #2635

Open
eromoe opened this issue Apr 14, 2024 · 2 comments
Open

How to recursive remove features by best loss ? #2635

eromoe opened this issue Apr 14, 2024 · 2 comments

Comments

@eromoe
Copy link

eromoe commented Apr 14, 2024

I follow the example to do recursive feature selection and find the target is reduce feature number to num_features_to_select .
Instead of set num_features_to_select, I want to reduce feature number by best loss .

As my selection plots :
image

Here, we can see the number of removed features in 70 ~ 270 get best loss . So 270 is the maximum number for removing features.
But I didn't find api for this purpose. It would be good to include best loss features in summary = model.select_features(...) .

@ek-ak
Copy link
Collaborator

ek-ak commented May 6, 2024

Hello! Sorry for the long wait for an answer to your question.
It looks like a useful feature, thanks for the request!

You can obtain this information about best loss_features from summary, i e:

summary = model.select_features(...)
values = summary['loss_graph']['loss_values']
best_iteration = values.index(min(values))
eliminated_features = summary['eliminated_features'][:best_iteration]

@eromoe
Copy link
Author

eromoe commented May 7, 2024

Thanks. Yeah it's very useful and may need some parameters for balancing best loss and maximum number of removal features.

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