patpy.tl.evaluate_prediction

patpy.tl.evaluate_prediction#

patpy.tl.evaluate_prediction(y_true, y_pred, task, **parameters)#

Evaluate how well y_pred predicts y_true

Parameters:
  • y_true (array-like) – Vector with the values of a feature

  • y_pred (array-like) – Vector with the predicted values of a feature

  • task (Literal["classification", "regression", "ranking"]) – Type of prediction task. See documentation of predict_knn for more information

Returns:

-result (dict) Result of evaluation with the following keys: - score: score of the prediction - metric: name of the metric used for evaluation. The following metrics are currently used:

  • f1_macro_calibrated: F1 score for classification task. Calibrated to have value 0 for random prediction and 1 for perfect prediction

  • spearman_r: Spearman correlation for regression and ranking tasks