gpt4 book ai didi

python - LimeTabularExplainer 类型错误 : unhashable type: 'slice'

转载 作者:太空宇宙 更新时间:2023-11-03 13:58:34 24 4
gpt4 key购买 nike

我正在尝试使用 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com