Far*_*neh 5 python-3.x scikit-learn
这是我的导入行:
from sklearn.metrics import PrecisionRecallDisplay
Run Code Online (Sandbox Code Playgroud)
当我打字时
PrecisionRecallDisplay
Run Code Online (Sandbox Code Playgroud)
我明白了
sklearn.metrics._plot.precision_recall_curve.PrecisionRecallDisplay
Run Code Online (Sandbox Code Playgroud)
插入的
sklearn.metrics.PrecisionRecallDisplay
Run Code Online (Sandbox Code Playgroud)
我正在尝试运行以下代码行:
display = PrecisionRecallDisplay.from_estimator(lr_clf, x_test, y_test, name = "Logistic Regression")
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
AttributeError: type object 'PrecisionRecallDisplay' has no attribute 'from_estimator'
Run Code Online (Sandbox Code Playgroud)
我正在使用最新版本的sklearn。('0.24.2')
0.24.2 不是scikit -learn\xe2\x80\x94 的最新版本,截至撰写本文时,1.0 版本已于两天前发布。您需要升级到该版本才能使用,PrecisionRecallDisplay.from_estimator因为 0.24.2 版本早于添加PrecisionRecallDisplay.from_estimator几个月。
如果您使用的是 conda,则可以使用以下命令进行升级
\nconda upgrade -c conda-forge scikit-learn\nRun Code Online (Sandbox Code Playgroud)\n或者,与pip,
python -m pip install scikit-learn --upgrade\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
5294 次 |
| 最近记录: |