vocalpy.metrics.segmentation.ir.IRMetricData

vocalpy.metrics.segmentation.ir.IRMetricData#

class vocalpy.metrics.segmentation.ir.IRMetricData(hits_ref: ndarray[Any, dtype[_ScalarType_co]], hits_hyp: ndarray[Any, dtype[_ScalarType_co]], diffs: ndarray[Any, dtype[_ScalarType_co]])[source]#

Bases: object

Class representing data used to compute an information retrieval metric.

This class contains data needed to compute metrics like precision and recall for estimated event times compared to reference event times.

The class attributes are the variables returned by vocalpy.metrics.segmentation.find_hits(). Instances of this class are returned by along with the value of the computed metrics.

The values can be useful when computing additional statistics, e.g., the classes of segments that had higher or lower precision or recall, or the distribution of differences between reference times and estimated times for some class of events.

Attributes:
hits_refnumpy.ndarray

The indices of hits in reference.

hits_hypnumpy.ndarray

The indices of hits in hypothesis.

diffsnumpy.ndarray

Absolute differences \(|hit^{ref}_i - hit^{hyp}_i|\), i.e., np.abs(reference[hits_ref] - hypothesis[hits_hyp]).

__init__(hits_ref: ndarray[Any, dtype[_ScalarType_co]], hits_hyp: ndarray[Any, dtype[_ScalarType_co]], diffs: ndarray[Any, dtype[_ScalarType_co]]) None#

Method generated by attrs for class IRMetricData.

Methods

__init__(hits_ref, hits_hyp, diffs)

Method generated by attrs for class IRMetricData.

Attributes

hits_ref

hits_hyp

diffs