Comments (16)
See if you can set
dtreeviz.color_blind_friendly_colors[30+1] = [c]*30
for some colorc
.
Worked, thanks :)
Had to change the NUM_BINS array as well
from dtreeviz.
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.
Wow, quick response!
So there is nothing I can do at the moment?
from dtreeviz.
Nope :( sorry.
from dtreeviz.
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.
thanks :) I'd be happy to accept a pull request that increased the number of color palettes ;)
from dtreeviz.
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.
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.
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.
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.
In principle, just add another list of colors so this works:
color_values = color_blind_friendly_colors[n_classes]
from dtreeviz.
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.
See if you can set dtreeviz.color_blind_friendly_colors[30+1] = [c]*30
for some color c
.
from dtreeviz.
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.
Hi folks, if you still need a solution for this issue, you can follow this PR #185
from dtreeviz.
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)
- Visualize custom decision tree HOT 1
- how to use dtreeviz in streamlit HOT 2
- VisualisationNotYetSupportedError: get_min_samples_leaf() is not implemented yet for XGBoost. HOT 4
- TypeError: list indices must be integers or slices, not numpy.float64 HOT 5
- Crash when leaf nodes have no samples HOT 1
- Out of memory when calling viz.view() HOT 2
- Integrate AI explanation
- CatBoost need to be supported. HOT 1
- AttributeError: module 'dtreeviz' has no attribute 'model' on Windows platform, works fine on Google colab
- tfdf.keras.CartModel support? HOT 1
- TypeError: 'int' object is not subscriptable HOT 3
- Development requirement in `setup.py` HOT 1
- Adjust Bounding Box of saved svg file
- DTreeViz crashes, if descision tree was built with objects, that are interpretable as numbers.
- How to use chinese? HOT 1
- get_score() is not implemented yet for XGBoost. HOT 1
- cannot import name 'dtreeviz' from 'dtreeviz.trees HOT 1
- VisualisationNotYetSupportedError: get_node_criterion() is not implemented yet for LightGBM
- VisualisationNotYetSupportedError: get_feature_path_importance() is not implemented yet for LightGBM
- Any way to filter features before plotting with instance_feature_importance(x,figsize=(10,12))? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dtreeviz.