plot_precision_recall

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

plot_precision_recall(y_true: ndarray | None = None, y_prob: ndarray | None = None, *, curves: Mapping[str, Tuple[ndarray, ndarray]] | None = None, model_name: str = 'model', title: str = 'Precision-Recall')[source]

Precision-recall curve(s) with average precision in the legend.

Parameters:
  • y_true – Binary labels for a single series.

  • y_prob – Positive-class probabilities for a single series.

  • curves – Optional multi-model overlay panel.

  • model_name – Legend name when using the single-series form.

  • title – Figure title (sanitised).

Returns:

The matplotlib Figure.