在make_scorer
的文档中没有很好地解释它们之间的区别。我观察到,如果将needs_proba
或needs_threshold
设置为True,则评分函数将接收到pred_proba
而不是y_pred
。但是,不可能将它们都设置为True。这会导致错误。
ValueError: Set either needs_proba or needs_threshold to True, but not both
needs_threshold的文档指出:
我理解为如果评分是average_precision或roc_auc_score,则需要将needs_threshold设置为True。然而,无论needs_threshold是True还是False,它的工作方式都是相同的。例如,仅使用离散预测无法计算average_precision或roc曲线下面积。
请问您能帮忙解释一下它们之间的区别以及如何使用
needs_threshold
吗?