torch_ecg.utils.QRS_score

torch_ecg.utils.QRS_score(rpeaks_truths: Sequence[Union[numpy.ndarray, Sequence[int]]], rpeaks_preds: Sequence[Union[numpy.ndarray, Sequence[int]]], fs: numbers.Real, thr: float = 0.075) float[source]

QRS accuracy score, proposed in CPSC2019.

Parameters
  • rpeaks_truths (array_like) – array of ground truths of rpeaks locations (indices) from multiple records.

  • rpeaks_preds (array_like) – predictions of ground truths of rpeaks locations (indices) for multiple records.

  • fs (numbers.Real) – Sampling frequency of ECG signal

  • thr (float, default 0.075) – Threshold for a prediction to be truth positive, with units in seconds.

Returns

rec_acc – Accuracy of predictions.

Return type

float