TabularPredictor.evaluate¶
- TabularPredictor.evaluate(data: DataFrame | str, model: str = None, decision_threshold: float = None, display: bool = False, auxiliary_metrics: bool = True, detailed_report: bool = False, **kwargs) dict[source]¶
报告在给定数据集上评估的预测性能。 这基本上是以下操作的快捷方式:pred_proba = predict_proba(data); evaluate_predictions(data[label], pred_proba)。
- Parameters:
data (str 或
pd.DataFrame) – 此数据集还必须包含与之前指定的列名相同的label。 如果传递的是str,data将使用str值作为文件路径加载。 如果设置了self.sample_weight并且self.weight_evaluation==True,则会检查并使用具有样本权重名称的列进行加权指标评估(如果存在)。model (str (optional)) – 用于获取预测概率的模型名称。默认为 None,表示使用验证集上得分最高的模型。 有效的模型可以通过调用 predictor.model_names() 在此 predictor 中列出。
decision_threshold (float, default = None) – The decision threshold to use when converting prediction probabilities to predictions. This will impact the scores of metrics such as f1 and accuracy. If None, defaults to predictor.decision_threshold. Ignored unless problem_type=’binary’. Refer to the predictor.decision_threshold docstring for more information.
display (bool, default = False) – If True, performance results are printed.
auxiliary_metrics (bool, default = True) – Should we compute other (problem_type specific) metrics in addition to the default metric?
detailed_report (bool, default = False) – Should we computed more detailed versions of the auxiliary_metrics? (requires auxiliary_metrics = True)
- Returns:
返回字典,其中键 = 指标,值 = 每个指标的性能。要获取eval_metric分数,请执行output[predictor.eval_metric.name]
注意 (指标分数始终以越高越好的形式显示。)
这意味着诸如log_loss和root_mean_squared_error等指标的符号将被翻转,值将为负数。