met*_*211 6 python machine-learning logistic-regression data-science shap
shapley 支持逻辑回归模型吗?
运行以下代码我得到:
logmodel = LogisticRegression()
logmodel.fit(X_train,y_train)
predictions = logmodel.predict(X_test)
explainer = shap.TreeExplainer(logmodel )
Exception: Model type not yet supported by TreeExplainer: <class 'sklearn.linear_model.logistic.LogisticRegression'>
Run Code Online (Sandbox Code Playgroud)
PS 你应该对不同的模型使用不同的解释器
| 归档时间: |
|
| 查看次数: |
11358 次 |
| 最近记录: |