Skip to content

API reference / Evaluation

tsdive.eval.clock_control

clock_control(
    record_position: Mapping[Any, int] | Series,
) -> dict[Any, float]

Score every window by how far into its own record it sits.

The control reads no sensor value. A record that opens normal and stays faulty once the fault arrives is separable by position alone, so the control is published beside every detector: the gap between a detector's AUC and this row's AUC is what the detector adds over time.

record_position maps a window key to its position in its record, as a Mapping or a pandas.Series indexed by key. The result maps each key to float(position) in the same order.

Examples:

>>> from tsdive.eval import clock_control
>>> clock_control({"window-a": 0, "window-b": 3})
{'window-a': 0.0, 'window-b': 3.0}