-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Incompability between scikit-learn and xgboost #11093
Comments
I have the same error when I finished to fit a model and then try to print it in a jupyter notebook, as well as when I try to load a model |
@piotrjacak Try using scikit learn version 1.5.0, does it solve your issue? |
Thank you, it helped. As I tried to figure this out I found another solution. I wrapped XGBClassifier into a class, using sklearn BaseEstimator and ClassifierMixin. Then I passed instance of this class to GridSearchCV. I used following code:
|
We experienced the same issue. I think it's related to some changes in release of scikit-learn 1.6.0., see scikit-learn/scikit-learn#30122 and recent release notes https://scikit-learn.org/stable/whats_new/v1.6.html#sklearn-base see Issue DoubleML/doubleml-for-py#278 for DoubleML |
The fix is in the master branch, but it will take some time for us to make a new release, please keep sklearn at 1.5 or use the nightly XGB build. |
I have xgboost 2.1.3 and scikit-learn 1.6.0.
After running this code
grid_search = GridSearchCV(XGBClassifier(objective='binary:logistic'), param_grid, scoring='accuracy', cv=5, verbose=1)
grid_search.fit(X_train, y_train)
I got following error
The text was updated successfully, but these errors were encountered: