mlnext.score.auc_point_adjust_metrics#

mlnext.score.auc_point_adjust_metrics(*, y_hat: ndarray, y: ndarray) Dict[str, float][source]#

Calculates the area under the curve for performance metrics with point-adjusted predictions for values of k in [0,100].

Parameters:
  • y_hat (np.ndarray) – Label predictions.

  • y (np.ndarray) – Ground truth labels.

Returns:

Returns a mapping from performance metric to auc.

Return type:

T.Dict[str, float]

Example

>>> import mlnext
>>> import numpy as np
>>> auc_point_adjust(
...   y_hat=np.array([0, 1, 1, 0]), y=np.array([0, 1, 1, 1]))
{'auc_accuracy': 0.91875,
 'auc_precision': 1.0,
 'auc_recall': 0.8916666666666666,
 'auc_f1': 0.935,
 'auc_roc_auc': 0.9458333333333333}