'super' object has no attribute '__sklearn_tags__' [Solved]

Written by- Aionlinecourse160 times views

'super' object has no attribute '__sklearn_tags__' [Solved]

If you're working with scikit-learn and encountered the error:

AttributeError: 'Super' object has no attribute 'sklearn_tags'

You are not the only one! Indeed, this error can sometimes be quite troublesome. Don't worry, we will not leave you all by yourself. This guide will guide you through the mistake and take you through the necessary steps to fix it.

Why Does This Error Occur?

  • The parent class is outdated or lacks the sklearn_tags attribute.
  • There is a mismatch between the custom implementation and the newer scikit-learn API.


Solution 1: Check Your scikit-learn Version

Run the following command to check your scikit-learn version:

pip show scikit-learn

Ensure you’re using a compatible version. If the version is outdated, upgrade to the latest version:

pip install --upgrade scikit-learn

This ensures your environment uses the latest API, reducing compatibility issues.

See also sklearn Issue#30479 and 1.6.1 release notes.


Solution 2: Update Third-Party Dependencies

If the error originates from third-party libraries dependent on scikit-learn, ensure those libraries are updated. Use:

pip list --outdated

Update outdated packages to maintain compatibility:

pip install --upgrade <package_name>

This avoids conflicts between library versions.


Solution 3: Pin Compatible Versions

If upgrading is not feasible, consider pinning the scikit-learn version to match your existing implementation. For example:

pip install scikit-learn==1.1.3

This ensures consistency in your development environment.



Thank you for reading the article. To avoid issues in the future, it is necessary but useful to keep your dependencies up-to-date and follow the standards of your chosen libraries. If you benefitted from this guide, share it with your friends! For more troubleshooting tips, visit our site.