Code Monkey home page Code Monkey logo

Comments (16)

chenhajaj avatar chenhajaj commented on May 13, 2024 2

See if you can set dtreeviz.color_blind_friendly_colors[30+1] = [c]*30 for some color c.

Worked, thanks :)
Had to change the NUM_BINS array as well

from dtreeviz.

parrt avatar parrt commented on May 13, 2024

ah. yeah, sorry. I should put a check in there but only 10 classes can be handled right now. we had to handpick the colors. sorry about that.

from dtreeviz.

CermakM avatar CermakM commented on May 13, 2024

Wow, quick response!

So there is nothing I can do at the moment?

from dtreeviz.

parrt avatar parrt commented on May 13, 2024

Nope :( sorry.

from dtreeviz.

CermakM avatar CermakM commented on May 13, 2024

Okay, let's hope for a quick solution in the bright future. Keep up the good work and thanks for the quick response.

from dtreeviz.

parrt avatar parrt commented on May 13, 2024

thanks :) I'd be happy to accept a pull request that increased the number of color palettes ;)

from dtreeviz.

Ashafix avatar Ashafix commented on May 13, 2024

It's a bit more tricky than just having more colors.

get_num_bins gets called with n_classes as well and it references NUM_BINS which also only has 10 values.
What would be a good default value for NUM_BINS for n_classes > 10?

Any good ideas about having more colors?
Just repeating the colors and giving a warning, or making up new colors?

from dtreeviz.

parrt avatar parrt commented on May 13, 2024

Yeah, That's the problem. I started running out of ideas for colors and default values above 10. May be a sequential color map is required.

from dtreeviz.

EricCacciavillani avatar EricCacciavillani commented on May 13, 2024

Currently running into the same issue for an idea I am testing.
But totally understandable. Maybe a semi-simple and quick workaround is just to declare a simple target to color hex dict or just allowing us to passing in a list of colors.

As in the user declares the targets to color dict on their end.

{0: "#fcba03", 1: "#a303a9"}

from dtreeviz.

chenhajaj avatar chenhajaj commented on May 13, 2024

Any solution? I even considered not using colors, but when I add None to the color_blind_friendly_colors array (colors.py), I get the following error:
color_map = {v: color_values[i] for i, v in enumerate(class_values)}

TypeError: 'NoneType' object is not subscriptable

from dtreeviz.

parrt avatar parrt commented on May 13, 2024

In principle, just add another list of colors so this works:

color_values = color_blind_friendly_colors[n_classes]

from dtreeviz.

chenhajaj avatar chenhajaj commented on May 13, 2024

In principle, just add another list of colors so this works:

color_values = color_blind_friendly_colors[n_classes]

I have 30 classes. I don't really care about colors, they can all be represented by the same color.
Can I make it work?

from dtreeviz.

parrt avatar parrt commented on May 13, 2024

See if you can set dtreeviz.color_blind_friendly_colors[30+1] = [c]*30 for some color c.

from dtreeviz.

benelot avatar benelot commented on May 13, 2024

Maybe allow to represent only certainty of the written class via the hue. Then you can either have hue="class_certainty" or hue="certainty", and it switches to hue="certainty" above 10 classes and probably drops a warning that it did.

from dtreeviz.

tlapusan avatar tlapusan commented on May 13, 2024

Hi folks, if you still need a solution for this issue, you can follow this PR #185

from dtreeviz.

0ptimista avatar 0ptimista commented on May 13, 2024

@tlapusan tla, @parrt

Hi, I really appreciate the work making support on more classes.

I now have a 86 classes decision tree model. Is it any possible way to call decision_boundaries without color issue?( "Index Error")

Or It's a bad idea having 86 classes , should I make my classes smaller?

from dtreeviz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.