TabularPredictor.evaluate_predictions

TabularPredictor.evaluate_predictions(y_true, y_pred, sample_weight=None, decision_threshold=None, display: bool = False, auxiliary_metrics=True, detailed_report=False, **kwargs) dict[source]

评估提供的预测概率与真实标签的对比。 评估基于之前在init中指定的eval_metric,如果未指定,则使用默认指标。

Parameters:
  • y_true (np.arraypd.Series) – 真实标签的有序集合。

  • y_pred (pd.Seriespd.DataFrame) – 预测概率或预测的有序集合。 可通过 predictor.predict_proba 的输出获得。 注意:对于某些类型的 eval_metric(如 ‘roc_auc’),y_pred 必须是预测概率而不是预测标签。

  • sample_weight (pd.Series, default = None) – 每行数据的样本权重。如果为None,则使用统一的样本权重。

  • decision_threshold (float, default = None) – 用于将预测概率转换为预测的决策阈值。 这将影响诸如f1accuracy等指标的分数。 如果为None,则默认为predictor.decision_threshold。除非problem_type=’binary’,否则忽略。 有关更多信息,请参阅predictor.decision_threshold的文档字符串。

  • display (bool, default = False) – 如果为True,性能结果将被打印出来。

  • auxiliary_metrics (bool, default = True) – 除了默认指标外,我们是否应该计算其他(problem_type 特定的)指标?

  • detailed_report (bool, default = False) – 我们是否应该计算更详细版本的auxiliary_metrics?(需要auxiliary_metrics = True

Returns:

  • 返回字典,其中键 = 指标,值 = 每个指标的性能。

  • 注意 (指标分数始终以越高越好的形式显示。)

  • 这意味着像 log_loss 和 root_mean_squared_error 这样的指标将会有它们的符号翻转,并且值将为负数。