Questions tagged [eli5]

ELI5 is a Python library which allows to visualize and debug various machine learning models using a unified API

From the documentation:

ELI5 is a Python library which allows to visualize and debug various machine learning models using unified API. It has built-in support for several ML frameworks and provides a way to explain black-box models.

It is not to be confused with Reddit's "Explain Like I'm Five" (ELI5) or the ELI programming_language.

29 questions
5
votes
1 answer

Question about Permutation Importance on LSTM Keras

from keras.wrappers.scikit_learn import KerasClassifier, KerasRegressor import eli5 from eli5.sklearn import PermutationImportance model = Sequential() model.add(LSTM(units=30,return_sequences= True,…
rorivy15
  • 91
  • 2
  • 8
4
votes
2 answers

How to explain text clustering result by feature importance? (DBSCAN)

There are similar questions and libraries like ELI5 and LIME. But I couldn't find a solution to my problem. I have a set of documents and I am trying to cluster them using scikit-learn's DBSCAN. First, I am using TfidfVectorizer to vectorize the…
MehmedB
  • 1,059
  • 1
  • 16
  • 42
3
votes
1 answer

ModuleNotFoundError: No module named 'sklearn.metrics.scorer'

I was trying to use the eli5 package in Python. Initially I was unable to install that, but later fixed it with conda install -c conda-forge eli5. Now when I try to import eli5 into my Jupyter Notebbok, I get the following…
3
votes
2 answers

AttributeError: module 'jinja2.ext' has no attribute 'with_'

I tried to install eli5 Python package via the below command in my google colab file. !pip install eli5 And I'm getting this error when running the above command. AttributeError: module 'jinja2.ext' has no attribute 'with_' I tried to update…
Sanushi Salgado
  • 1,195
  • 1
  • 11
  • 18
3
votes
1 answer

Right way to use RFECV and Permutation Importance - Sklearn

There is a proposal to implement this in Sklearn #15075, but in the meantime, eli5 is suggested as a solution. However, I'm not sure if I'm using it the right way. This is my code: from sklearn.datasets import make_friedman1 from…
3
votes
1 answer

eli5 explain_weights_xgboost KeyError: 'bias'

I am new to xgboost, I trained a model, that works pretty well. Now I am trying to use eli5 to see the weights and I get: KeyError: 'bias' --------------------------------------------------------------------------- KeyError …
Elena Root
  • 115
  • 1
  • 6
3
votes
1 answer

`eli5.show_weights` displayed standard deviation does not agree with the values in `feature_importances_std_`

The PermutationImportance object has some nice attributes such as feature_importances_ and feature_importances_std_. To visualize in an HTML style this attributes I used eli5.show_weights function. However, I noticed that the displayed standard…
seralouk
  • 30,938
  • 9
  • 118
  • 133
3
votes
2 answers

What exactly does `eli5.show_weights` display for a classification model?

I used eli5 to apply the permutation procedure for feature importance. In the documentation, there is some explanation and a small example but it is not clear. I am using a sklearn SVC model for a classification problem. My question is: Are these…
seralouk
  • 30,938
  • 9
  • 118
  • 133
2
votes
1 answer

eli5 show_prediction shows only feature weights and not example prediction

When I use the eli5 show prediction function I only see the feature weights and not the color highlighted example. I have the following sklearn pipeline pipeline = Pipeline([ ('tfidf', TfidfVectorizer(analyzer='word', use_idf=True, …
mjspier
  • 6,386
  • 5
  • 33
  • 43
2
votes
1 answer

eli5 permuter.feature_importances_ returning all zeros

I'm trying to get permutation importances for a RandomForestClassifier on a small sample of data, but while I can get simple feature importances, my permutation importances are coming back as all zeros. This is the code: Input1: X_train_encoded =…
ekselan
  • 137
  • 1
  • 10
2
votes
1 answer

How to get feature names from ELI5 when transformer includes an embedded pipeline

The ELI5 library provides the function transform_feature_names to retrieve the feature names for the output of an sklearn transformer. The documentation says that the function works out of the box when the transformer includes nested Pipelines. I'm…
hsafer
  • 57
  • 1
  • 9
1
vote
0 answers

Python render eli5 explanation to image

I'm using the eli5 library to explain a sklearn decision tree in a Jupyter notebook by calling eli5.show_weights(...). The output is an IPython.core.display.HTML element that I can display inside the notebook with…
Marc Bacvanski
  • 1,458
  • 4
  • 17
  • 33
1
vote
1 answer

Issue with importing TextExplainer from eli5.lime package relating to deprecated 'itemfreq' function

I am working on a BERT model for text classification and wish to use TextExplainer for model interpretation. However, when loading the library eli5.lime I receive the following error: ImportError: cannot import name 'itemfreq' from 'scipy.stats' It…
1
vote
2 answers

ELI5 package yielding all positive weights for XGBoost feature importance

I've trained an XGBoost model using Sklearn, and I'm extracting feature importance using the eli5 package. I noticed that all my feature importances were positive: For example: How would I distinguish between features that have a positive/negative…
Sandro
  • 29
  • 1
  • 3
1
vote
0 answers

eli5.permutation_importance get_score_importances crashes Google Colab session

I came across eli5.permutation_importance get_score_importances from the following article: https://towardsdatascience.com/how-to-find-feature-importances-for-blackbox-models-c418b694659d; here is the documentation. When I try to use…
CLopez138
  • 33
  • 5
1
2