我正在尝试使用 LIME 包来解释预测模型。运行以下代码时看到错误:
# Create the LIME Explainer
explainer = lime.lime_tabular.LimeTabularExplainer(X_train_undersample feature_names = feature_names,class_names=['0','1'], kernel_width=3)
错误:
TypeError: unhashable type: 'slice'
这可能是什么问题?
最佳答案
如果您的 x_train 是一个 DataFrame,请尝试像这样传递它:
x_train_undersample.as_matrix()
关于python - LimeTabularExplainer 类型错误 : unhashable type: 'slice' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49422381/