我一直在尝试以字典的形式获取分类报告。所以根据 scikit-learn 0.20 文档,我这样做:from sklearn import metricsrep = metrics.classification_report(y_true, y_pred, output_dict=True)但是得到一个错误说TypeError: classification_report() got an unexpected keyword argument 'output_dict'The scikit-learn module in my machine was initially 0.19.1 but even after updating it to 0.20, the same error message shows.
1 回答

汪汪一只猫
TA贡献1898条经验 获得超8个赞
只要您安装了 scikit-learn 0.20.0,就不应该出现此错误。如果您在 jupyter 笔记本中尝试此操作,请使用以下方法确保正确的版本反映在您的笔记本中:
import sklearn print(sklearn.__version__)
如果您升级了 scikit-learn 但 jupyter 显示了错误版本的软件包,请确保在当前环境中安装了 jupyter(并在新终端中重新启动 jupyter)。
添加回答
举报
0/150
提交
取消