User avatar
josh_amayo
Oval
Hyperparam tuning (Grid Search/Randomized)
Help · 19 Dec 2024, 14:47 · 5

Anyone else encountering this error when fitting before hyperparamter tuning? - AttributeError: 'super' object has no attribute '__sklearn_tags__'.

Have gotten the same error in different environments (Colab and Pycharm) so i'm curious whether it's a wide-spread issue.

Discussion 5 answers
User avatar
Freelance

I'm guessing you're using lightGBM, because I got a similar warning about this "sklearn_tags"?

If yes, I think it has to do with the latest version of the package. Probably you may need to use the other API for using the package instead of the sklearn-like API. I haven't used the package for hyperparameter tuning.

19 Dec 2024, 14:54
Upvotes 0
User avatar
josh_amayo
Oval

Using XGB actually. Ok noted

yes I'm only getting it with XGB though

I wrote a custom wrapper for xgb which migh indicate that there is an issue with sklearn accessing the XGB interface for some reason

I've tried to update the package but the problem persists. check out the gthub for the source code to see if a solution was discussed in the issues tab.

Alternatively you can use a different api for hyperparameter tuning

19 Dec 2024, 14:59
Upvotes 0
User avatar
josh_amayo
Oval

Will have a look at the github. Thinking of installing an older version of xgb/sklearn.

I thought using Optuna would yield different results but got the same error.

User avatar
BanterGent96
Wits University

Hi guys, as many of you have mentioned, this is a compatibility issue with the latest version of sklearn. Just use version 1.5.2

`pip install sklearn==1.5.2`

5 Jan 2025, 13:04
Upvotes 0