detection

Detection regime — per-window classification metrics.

This is what most of the literature calls “sample-based” evaluation (Andrade 2024). Built on sklearn for the threshold-free metrics (AUROC, AUPRC, Brier) and on timescoring.SampleScoring for the threshold-dependent confusion-matrix metrics.

Use this when: - Your model emits one probability per fixed-length window (clip-level

classification, e.g. 10-min preictal-vs-interictal).

  • You want the imbalance-aware metrics (AUPRC + balanced accuracy + MCC) that no NeuroVista paper has reported (gap noted in the literature review).

scitex_seizure_metrics.detection.evaluate(y_true, y_proba, *, threshold=0.5, fs=1, name='')[source]

Evaluate a continuous-output classifier on per-window labels.

Parameters:
  • y_true – 1-D binary array of ground-truth labels (1 = pre-ictal).

  • y_proba – 1-D continuous score / probability matched to y_true.

  • threshold (float) – cutoff for the binary-mask metrics (sensitivity etc.). AUROC/AUPRC/Brier are threshold-free.

  • fs (int) – sampling frequency of the label vector (Hz). Defaults to 1 (one label per second, or per window if windows are 1-s spaced — adjust accordingly).

  • name (str) – identifier carried into the report.

Returns:

MetricsReport with the detection-regime fields populated.

Return type:

MetricsReport