callcut.evaluation.BaseIntervalMatcher🔗

class callcut.evaluation.BaseIntervalMatcher[source]🔗

Abstract base class for interval matching strategies.

Matchers pair predicted intervals with ground truth intervals for evaluation purposes. Different matching strategies may use different criteria (IoU, boundary tolerance, etc.).

Methods

match(ground_truth, predictions)

Match predicted intervals to ground truth intervals.

Examples

Create a custom matcher by subclassing:

>>> class BoundaryMatcher(BaseIntervalMatcher):
...     def __init__(self, tolerance_ms: float = 50.0):
...         self._tolerance_ms = tolerance_ms
...
...     def match(self, ground_truth, predictions):
...         # Match based on onset boundary tolerance
...         ...
abstractmethod match(ground_truth, predictions)[source]🔗

Match predicted intervals to ground truth intervals.

Parameters:
ground_truthlist of Interval

Ground truth call intervals.

predictionslist of Interval

Predicted call intervals.

Returns:
matcheslist of Match

List of matches, where each match pairs a ground truth index with a prediction index. Each ground truth and prediction can appear in at most one match.