![](/img/trans.png)
[英]How can I set floating point precision to avoid floating point arithmetic error in Python?
[英]How to set floating point precision in Sklearn RocCurveDisplay?
如果使用RocCurveDisplay
作為打印精度是硬編碼的,似乎你不能這樣做:
if self.roc_auc is not None and name is not None:
line_kwargs["label"] = f"{name} (AUC = {self.roc_auc:0.2f})"
elif self.roc_auc is not None:
line_kwargs["label"] = f"AUC = {self.roc_auc:0.2f}"
elif name is not None:
line_kwargs["label"] = name
見https://github.com/scikit-learn/scikit-learn/blob/7e1e6d09b/sklearn/metrics/_plot/roc_curve.py#L110
You need to plot the ROC curve in a more manual way, see https://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html and add the legend label with the precision you wish for.
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.