shap

How to get feature names of shap_values from TreeExplainer?

How to get feature names of shap_values from TreeExplainer? Question: I am doing a shap tutorial, and attempting to get the shap values for each person in a dataset from sklearn.model_selection import train_test_split import xgboost import shap import numpy as np import pandas as pd import matplotlib.pylab as pl X,y = shap.datasets.adult() X_display,y_display = shap.datasets.adult(display=True) …

Total answers: 2

SHAP DeepExplainer with TensorFlow 2.4+ error

SHAP DeepExplainer with TensorFlow 2.4+ error Question: I’m trying to compute shap values using DeepExplainer, but I get the following error: keras is no longer supported, please use tf.keras instead Even though i’m using tf.keras? KeyError Traceback (most recent call last) in 6 # …or pass tensors directly 7 explainer = shap.DeepExplainer((model.layers[0].input, model.layers[-1].output), background) 8 …

Total answers: 1

Use SHAP values to explain LogisticRegression Classification

Use SHAP values to explain LogisticRegression Classification Question: I am trying to do some bad case analysis on my product categorization model using SHAP. My data looks something like this: corpus_train, corpus_test, y_train, y_test = train_test_split(data[‘Name_Description’], data[‘Category_Target’], test_size = 0.2, random_state=8) vectorizer = TfidfVectorizer(stop_words=’english’, ngram_range=(1, 3), min_df=3, analyzer=’word’) X_train = vectorizer.fit_transform(corpus_train) X_test = vectorizer.transform(corpus_test) model …

Total answers: 2

How to understand Shapley value for binary classification problem?

How to understand Shapley value for binary classification problem? Question: I am very new to shapley python package. And I am wondering how should I interpret the shapley value for the Binary Classification problem? Here is what I did so far. Firstly, I used a lightGBM model to fit my data. Something like import shap …

Total answers: 1