Skip to content

Update Dependencies for Latest Version Tests#1328

Open
bbengfort wants to merge 4 commits intoDistrictDataLabs:developfrom
bbengfort:update-deps
Open

Update Dependencies for Latest Version Tests#1328
bbengfort wants to merge 4 commits intoDistrictDataLabs:developfrom
bbengfort:update-deps

Conversation

@bbengfort
Copy link
Copy Markdown
Member

@bbengfort bbengfort commented Jun 26, 2025

This PR is an update to all of the test dependencies to ensure Yellowbrick works with the latest versions of it's primary dependencies.

This PR fixes #1327

I have made the following changes:

  1. Updated the tests/requirements.txt
  2. Updated all of the baseline images with the new versions
  3. Fixed import errors and other issues in the code
  4. Updated tests as necessary

CHECKLIST

  • Is the commit message formatted correctly?
  • Have you noted the new functionality/bugfix in the release notes of the next release?
  • Included a sample plot to visually illustrate your changes?
  • Do all of your functions and methods have docstrings?
  • Have you added/updated unit tests where appropriate?
  • Have you updated the baseline images if necessary?
  • Have you run the unit tests using pytest?
  • Is your code style correct (are you using PEP8, pyflakes)?
  • Have you documented your new feature/functionality in the docs?
  • Have you built the docs using make html (must be run from docs/)?

@rebeccabilbro
Copy link
Copy Markdown
Member

Godspeed on the dependency updates @bbengfort -- I know this stuff can be finicky. Let me know if you would like me to pre-approve to help make merging smoother once CI passes. Really appreciate you diving back in to help revive Yellowbrick and get it back in sync with the latest scikit-learn!

edschofield added a commit to PythonCharmers/yellowbrick that referenced this pull request Mar 7, 2026
…ork with sklearn 1.6+ tags API

Starting in scikit-learn 1.6, the type-checking functions is_classifier(),
is_regressor(), is_clusterer(), and is_outlier_detector() were changed to
use a new tags-based mechanism. Instead of inspecting the _estimator_type
attribute directly, they now call get_tags(estimator), which in turn
invokes estimator.__sklearn_tags__() and checks the estimator_type field
on the returned Tags dataclass.

ContribEstimator did not implement __sklearn_tags__(), so when sklearn
called it, the call fell through to ContribEstimator.__getattr__(), which
proxied it to the wrapped third-party estimator. Since third-party
estimators (the whole reason ContribEstimator exists) typically don't
implement __sklearn_tags__() either, this raised an AttributeError,
causing all four type checks to fail.

The fix adds a __sklearn_tags__() method to ContribEstimator that builds
a default Tags object (via BaseEstimator) and replaces the estimator_type
field with the value from self._estimator_type when set. This preserves
the existing behavior where wrap(est, "classifier") makes the estimator
pass is_classifier() checks, while remaining forward-compatible with
sklearn's tags infrastructure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

yellowbrick is incompatible with sklearn v1.7.0

2 participants