我试图用石灰包来解释预测模型。运行以下代码时请参阅错误:
# 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'
有什么问题吗?在
Tags:
错误是因为您的X_train_欠采样是DataFrame stype。如果将DataFrame类型更改为数组类型(例如float64数组),就可以了。在
如果您的x_train是一个数据帧,请尝试如下方式传递它:
相关问题 更多 >
编程相关推荐