-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
KeyError: 'weight' with sklearn.feature_selection.SelectFromModel #5653
Comments
Hi, could you please post a more complete script that I can run? |
Sure, I will post it here this afternoon, so you can take a look at it. Thanks! |
This is a minimal
This is the corresponding
Here are the dataset and model to be unzipped in the same folder as the script. The model is a You can reproduce the reported problem with |
@GuidoBartoli Hi dude. I've had the same problem. I have used xgboost==1.0.0 version. Upgrading up to recent 1.1.0 helped. |
The issue is fixed in #5505 and the example script runs fine on XGBoost 1.1.0. |
Perfect, many thanks! |
Hi,
I'm using scikit-learn automatic feature selection together with a trained XGBoost model.
I set up a threshold to interrupt the feature reduction process when accuracy falls below it.
I think everything is fine in the loop, but when I use
SelectFromModel.transform()
I receive the following error:I'm using the latest xgboost 1.0.2 with scikit-learn 0.22 and below there is the code I wrote. It's part of a bigger script, so some variable are defined before, but the KeyError should not depend on that.
Anyone can reproduce this behaviour?
Many thanks in advance!
The text was updated successfully, but these errors were encountered: