Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'Rectangle' object has no attribute 'patches' #280

Open
tlapusan opened this issue Mar 12, 2023 · 5 comments
Open

AttributeError: 'Rectangle' object has no attribute 'patches' #280

tlapusan opened this issue Mar 12, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@tlapusan
Copy link
Collaborator

We introduced this fix here : #266, when a node will not contain samples from each label.

By filtering out those labels, we can have the situation when only a single label will be in a node, which will raise this error : AttributeError: 'Rectangle' object has no attribute 'patches'

@tlapusan tlapusan self-assigned this Mar 12, 2023
@parrt parrt added the bug Something isn't working label Mar 12, 2023
@baligoyem
Copy link

baligoyem commented Apr 14, 2023

After last update, errors below often occur in my case.
ValueError: The 'color' keyword argument must have one color per dataset, but 1 datasets and 0 colors were provided,
AttributeError: 'Rectangle' object has no attribute 'patches'
ValueError: need at least one array to concatenate

I think that these errors completely depend on the structure of the tree built.

Moreover, "try-except pass" structure doesn't work in the error of concatenation and I can't ignore the error message below.

image

@tlapusan
Copy link
Collaborator Author

@baligoyem what version of the library are you using?

@tlapusan
Copy link
Collaborator Author

@baligoyem and also which type of visualisation are you trying to make ? Your screenshot seems to be from path.py module from matplotlib library..

@parrt I think we don't have the latest PRs from dev into master and releases on pipy repository.

@baligoyem
Copy link

baligoyem commented Apr 17, 2023

@tlapusan

matplotlib==3.5.3
dtreeviz==2.2.0
lightgbm==3.3.3

I always get these errors when I try to build a dtreeviz model tree using LightGBM algorithm. There is no problem with sklearn trees.

@tlapusan
Copy link
Collaborator Author

@baligoyem we just made a new release 2.2.1. Can you check if it solves your issue ? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants