Comments (17)
I tried some approaches for making whitespace at the end visible: changing background, adding border, replacing it with single and double underscore (https://en.wikipedia.org/wiki/Underscore), white and black square, etc., but at the end solution I like the most is to just put features having space at the start or at the end in double quotes. It's also possible to apply it to just features having space at the end (as a space at the start is visible by indentation level), but for some reason applying this rule to space both at the start and at the end feels more natural. Here is how it looks like:
from eli5.
The main problem with "
is that it can be a part of a feature name, so feature names become ambiguous. Are there unambiguous options which look slightly worse, or do they all look much worse?
from eli5.
This was my second best, a double underscore, I almost went with it before thinking of quoting:
But it's also not strictly unambiguous (we could also just use more fancy quotes).
Let me think of something reasonably looking and really unambiguous.
from eli5.
Other options are adding a slight border or background, they look not terribly bad, but what I dislike is that all feature names become affected (I also use emspace here because it is larger and makes it more obvious that there is a gap).
from eli5.
I dislike is that all feature names become affected
I mean that it would look strange if we just apply these styles to items with space in them - it would seem that they are more important. But if we apply these styles only if there are some features with spaces, then it seems like a reasonable compromise.
from eli5.
what about highlighting only whitespaces, not features themselves?
from eli5.
Inspiration:
from eli5.
Thanks for the inspiration @kmike ! In the editor context I liked dots as spaces better, but in our case I think just highlighting spaces looks better.
I use just two colors here: darker green for positive and darker red for negative. I tried adjusting highlighting color according to the current weight color (making a darker version of weight color instead of using a constant color), but it looked worse.
Here is a notebook with new space highlighting scheme: https://github.com/TeamHG-Memex/eli5/blob/visible-space/notebooks/explain_text_prediction_char.ipynb
from eli5.
Yeah, I agree highlighting looks better.
What do you think about making it less bright, e.g. using S=70% and L=70%?
If the letter which is close to a whitespace is l or other similar letter it is a bit hard to distinguish with dark highlighting:
from eli5.
What about using light shade instead of medium shade for whitespaces?
from eli5.
dots are nice, but sometimes they can look cryptic:
from eli5.
Yeah, light shade looks much better for text!
About the darkness of color for html: I would rather fix it by adding a little margin, because the current darkness is barely visible over red of max intensity (there is already additional margin here but not looking like I would like):
Maybe lowering the max intensity of red and green could help, I'll check that.
from eli5.
Agreed, dots look nice with letters but no so nice with other dots :)
from eli5.
The margin looks good, I like it. Re max. density: text also is not very visible on the darkest red, maybe we should find a lighter color.
from eli5.
I raised the minimal lightness, here are the new colors: https://github.com/TeamHG-Memex/eli5/blob/visible-space/notebooks/explain_text_prediction_char.ipynb
from eli5.
Hm, now it became harder to see highlighting in text: for example, is this text classified as positive or negative, and what are important features?
(it is positive)
from eli5.
Right, it became too pale. I partly corrected that problem 6604b2c by using different color schemes for weights in table and text, but I think this particular example is also an indicator of another problem - the longer the text, the paler will the in-text features be compared to the BIAS, which stays the same.
from eli5.
Related Issues (20)
- Explaining multi-input model HOT 1
- import show_prediction issue HOT 3
- eli5 explains the importance of features by category
- pandas.core.indexes.base.Index not supported for feature_names params in show_weights
- How weights are calculated during local explainations?
- More detailed documentation of eli5.explain_prediction?
- PermutationImportance uses CV splitter indexes incorrectly
- Error: estimator XGBClassifier is not supported
- Making the world a cleaner place
- TypeError: check_cv() takes from 0 to 2 positional arguments but 3 were given HOT 2
- explain_prediction_lightgbm doesnt work for microsoft lightgbm HOT 1
- Pin version of jinja2 (and markupsafe) in requirements
- AttributeError when importing eli5 0.11.0
- Looping with explain_prediction_df crashes
- eli5.show_prediction doesn't work for my custom trained model
- Understanding show_weights html
- Pairing RFECV and RandomForestRegressor with non-cv Permutation Importance returns NotFittedError
- Error importing eli5.lime due to deprecated 'itemfreq' from 'scipy.stats'
- Error : Estimator is not supported
- Does not support scikit-learn=1.3.0 HOT 7
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 eli5.