Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.
Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.
TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.
Uh oh!
There was an error while loading. Please reload this page.
-
I have been developing a custom estimator class that follows scikit-learn's estimator API. Up to scikit-learn version
1.5.2
, this was straightforward because the estimator checks did not enforce strict type checks on tags, so I didn't need to import scikit-learn at all, my custom estimator would simply implement the required interface.However, starting with scikit-learn version
1.6
, a new requirement was introduced: the estimator must implement a__sklearn_tags__()
method that returns an instance of scikit-learn’s internalTags
class. The built-in estimator checks now assert that the returned object is exactly an instance of thisTags
class, which forces me to subclass or at least import this class from scikit-learn. This creates a problem for projects that want to be compatible with the scikit-learn estimator API but do not want to include scikit-learn itself as a direct dependency, either to reduce install size or avoid version conflicts.Is there an easy or recommended way to satisfy this new scikit-learn 1.6+ tagging API requirement without having to add scikit-learn itself as a dependency? For example, can I somehow provide the Tags class or a compatible substitute so my custom estimator passes the checks, but without fully depending on the scikit-learn package?
Beta Was this translation helpful? Give feedback.
All reactions