DirectedChamfer#

DirectedChamfer(normalize=False)[source]#

Directed Chamfer distance between event points.

For detected time points \(A = (a_1, a_2, \ldots, a_n)\) and true time points \(B = (b_1, b_2, \ldots, b_m)\), the directed (unnormalized) Chamfer distance is defined as:

\[d(A, B) = \sum_{i=1}^{n} \left| a_i - b'_i \right|\]

where \(b'_i\) is the true event closest to \(a_i\), that is, \(b'_i = \arg \min_{b\in B} |a_i - b|\).

If X is provided, the time points are taken as the location indices in X. Otherwise, it is assumed that X has a RangeIndex.

Parameters:
normalizebool, default=False

If True, the Chamfer distance is normalized by the number of detected events, i.e., divided by \(n\). If unnormalized, making too many detections will be penalized, wherease the normalized distance penalizes only the average distance to the closest true events, regardless of the number of detections.