Closed vtphan closed 2 years ago
@lwgray I was able to reproduce this error on:
Python: 3.10.2 Yellowbrick: develop branch
Dependencies:
matplotlib==3.5.2
scipy==1.8.1
scikit-learn==1.1.1
numpy==1.22.4
cycler==0.11.0
Taking a look at it now.
@vtphan @lwgray this appears to be related to the new scikit-learn print functionality that attempts to render Estimators using matplotlib with interactive dropdowns, e.g.
Because the last line of the cell is visualizer
the notebook is trying to render it as output and because the visualizer extends Estimator
it goes through the scikit-learn pretty drawing functionality.
@vtphan this bug does not affect the behavior of the visualizer; you can still fit and show the visual image, but I can see how it can be annoying, so it's something we'll want to try to deal with.
It looks like this might be a subclassing issue; ModelVisualizer
renders just fine:
Turns out this is specifically a problem with KElbowVisualizer
-- PR fix coming.
Describe the bug In Jupyter Notebook, this code produces this error:
To Reproduce
Additional context The use case above is just an example. The bug shows in other complex use cases.