policy

AlarmPolicy — explicit container for the alarm-generation knobs that drive forecasting metrics. Required argument to all alarm-aware functions in scitex_seizure_metrics; never silently defaulted, so every reported number can be traced to the policy that produced it.

class scitex_seizure_metrics.policy.AlarmPolicy(sph_seconds, sop_seconds, cadence_seconds, refractory_seconds, alarm_threshold=0.5, merge_consecutive=True, fp_denominator='interictal')[source]

Bases: object

Knobs that govern how a continuous prediction stream is converted into discrete alarms, and how those alarms are matched to seizures.

Every alarm-based metric in scitex_seizure_metrics requires an explicit AlarmPolicy so reports are reproducible across papers.

Parameters:
  • sph_seconds (float) – Seizure Prediction Horizon (lead time required between an alarm and the earliest valid seizure). Andrade et al. 2024.

  • sop_seconds (float) – Seizure Occurrence Period (validity window after SPH within which the seizure must occur).

  • cadence_seconds (float) – Time step between successive predictions in the continuous stream. 60 s ≈ once-per-minute, 360 s ≈ once-per- 6-min. Defines the maximum theoretical alarm rate before refractory.

  • refractory_seconds (float) – Minimum gap between consecutive alarms. After an alarm fires, the next earliest alarm is suppressed until this much time has passed. Common choices: SOP, 30 min, 1 h.

  • alarm_threshold (float) – Probability threshold above which a window’s prediction triggers an alarm-candidate.

  • merge_consecutive (bool) – If True, runs of contiguous above-threshold windows count as one alarm (fired at the first window).

  • fp_denominator (Literal['interictal', 'total']) – Whether FP/hr is normalised by total recording time or by interictal-only time (with seizure ± SOP windows removed). The Mormann tradition is “interictal”.

alarm_threshold: float = 0.5
cadence_seconds: float
describe()[source]

Compact dict suitable for serialising into a metric report.

Return type:

dict

fp_denominator: Literal['interictal', 'total'] = 'interictal'
merge_consecutive: bool = True
refractory_seconds: float
sop_seconds: float
sph_seconds: float