get_precision_recall¶
- daart.eval.get_precision_recall(true_classes: ndarray, pred_classes: ndarray, background: int | None = 0, n_classes: int | None = None) dict[source]¶
Compute precision and recall for classifier.
- Parameters:
true_classes (array-like) – entries should be in [0, K-1] where K is the number of classes
pred_classes (array-like) – entries should be in [0, K-1] where K is the number of classes
background (int or NoneType) – defines the background class that identifies points with no supervised label; these time points are omitted from the precision and recall calculations; if NoneType, no background class is utilized
n_classes (int, optional) – total number of non-background classes; if NoneType, will be inferred from true classes
- Returns:
‘precision’ (array-like): precision for each class (including background class) ‘recall’ (array-like): recall for each class (including background class)
- Return type:
dict