Questions tagged [lime]

LIME (local interpretable model-agnostic explanations) is an explainability method used to inspect machine learning models. Include a tag for Python, R, etc. depending on the LIME implementation.

LIME (local interpretable model-agnostic explanations) is an explainability method used to inspect machine learning models and debug their predictions. It was originally proposed in “Why Should I Trust You?”: Explaining the Predictions of Any Classifier (Ribeiro et al., NAACL 2016) as a way to explain how models were making predictions in natural language processing tasks. Since then, people implemented the approach in several packages, and the technique inspired later techniques for "explainable machine learning," such as the SHAP approach.

Related Concepts

LIME Implementations

Implementations of this approach exist in several software packages.

Python

R

Further Reading

101 questions
1
vote
0 answers

LIME in R on xgboost model with objective 'count:poisson'

I am trying to use LIME in R to explain an xgboost model with the objective 'count:poisson'. It seems to work just fine for the standard 'reg:linear'. Is there a way around this? The question was previously asked here, but with no accepted…
dtrain18
  • 53
  • 5
1
vote
1 answer

NLP | LimeTextExplainer for bigrams

in my NLP task I want to understand the 'rule' of my classifier. For that purpose, I build a LimeTExtExplainer. c= make_pipeline(cv,naive_bayes) explainer = LimeTextExplainer(class_names=class_names, random_state=42, bow=False) exp =…
Epimetheus
  • 373
  • 2
  • 17
1
vote
1 answer

How to plot Lime report when there is a lot of features in data-set

I'm trying to plot lime report classification algorithm using the method as_pyplot_figure() for the explanation from LimeTabularExplainer. It is working but the data which i'm saving locally in html format using save_html() from mpld3 library which…
1
vote
2 answers

TypeError: reshape(): argument 'input' (position 1) must be Tensor, not numpy.ndarray

I am a high school student who doesn't having much experience in using PyTorch and LIME. I'm having a lot of trouble with my image shape. Initially my image shape was (3,224,224), however the LIME algorithm only works with images that are in this…
1
vote
1 answer

LIME Library in R throwing "Error: Response is constant across permutations. Please check your model"

Looking for a kind soul to help me solve this error in R with my current RF model: Error: Response is constant across permutations. Please check your model Here are the files needed to run the code: link Here is my code:…
1
vote
1 answer

How can I use Lime to classify my time series

I have my simplified model that looks like this: model = Sequential() model.add(LSTM(12, input_shape=(1000,12))) model.add(Dense(9, activation='sigmoid')) My training data has the shape: (900,1000,12) As you can see from the output layer I have 9…
bjornsing
  • 322
  • 6
  • 25
1
vote
0 answers

Multithreading Lime in Python

I am new in using python. I am trying to run the lime explainer for more than 10000 samples. I am using a 1D-CNN keras model to explain. import numpy as np import tensorflow as tf import keras from keras.models import Sequential from keras.layers…
Noura
  • 474
  • 2
  • 11
1
vote
1 answer

invalid 'dimnames' given for data frame when using lime on a keras CNN model in R

I am having the same error as How to fix "Invalid 'dimnames' given for data frame? when usin lime package in R Error in dimnames<-.data.frame(*tmp*, value = list(n)) : invalid 'dimnames' given for data frame I am trying to apply the lime function…
Noura
  • 474
  • 2
  • 11
1
vote
1 answer

error "object ‘coef.cv.glmnet’ is not exported by 'namespace:glmnet' " while loading Lime package in R -

I've successfully installed Lime (and glmnet) in R but when I try loading it i receive an error: > require(lime) Loading required package: lime Error: package or namespace load failed for ‘lime’: object ‘coef.cv.glmnet’ is not exported by…
Ankhnesmerira
  • 1,386
  • 15
  • 29
1
vote
0 answers

LIME feature value not matching

I'm using the package LIME in Python 3.7 but the output doesn't seem to be intuitive in some variables. def explain(index, num_features): exp = explainer.explain_instance(X_test.loc[index,:], rf.predict, num_features = num_features) …
1
vote
1 answer

Lime package not able to get predictions for CaretStack

I built a Caret ensemble model by stacking models together. The model ran successfully and I got encouraging results. The challenge came when I tried to use Lime to interpret the black box predictions. I got an error saying "The class of model must…
Bokkiem
  • 13
  • 4
1
vote
1 answer

Lime explainer shows prediction probabilities different to the classifier prediction - sentiment analysis

I am using Lime to trace the behavior behind why the model take his decision to predict if this sentence is (NEG, POS or NEUTRAL) and for the most of cases lime explain correctly but in case like this why i entered NEG sentence, the model predict…
1
vote
0 answers

Keras, LIME: No data provided for "lstm__input" in "explain" function

I receive ValueError: No data provided for "lstm__input". Need data for each key in: ['lstm__input'] while executing lime::explain I have latest lime version and looked thourgh all related topics to my problem. I have LSTM regression network and I…
humanhater
  • 11
  • 2
1
vote
1 answer

R: LIME returns error on different feature numbers when it's not the case

I'm building a text classifier of Clinton & Trump tweets (data can be found on Kaggle ). I'm doing EDA and modelling using quanteda package: library(dplyr) library(stringr) library(quanteda) library(lime) #data prep tweet_csv <-…
Kasia Kulma
  • 1,683
  • 1
  • 14
  • 39
0
votes
0 answers

Can I get LIME to work with my BERT regression model?

I am getting a somewhat inscrutable error every time I true to run the LIME text explainer on my BERT regression model. Basically, the BERT model produces a numerical prediction just fine for any text I supply it with, but when the LIME text…
Lodore66
  • 1,125
  • 4
  • 16
  • 34