change_point_detector

Offline / batch change-point detector interface.

class pysatl_cpd.core.change_point_detector.ChangePointDetectorDescription(*, name, parameters=<factory>)[source]

Bases: object

Static description of the detector for logging and benchmarking.

Variables:
  • name – Human-readable detector name.

  • parameters – Frozen dictionary of detector parameters. Values are normalised to hashable form during __post_init__.

Parameters:
name: str
parameters: frozendict[str, Hashable]
__post_init__()[source]

Normalise parameters to hashable values after initialisation.

Return type:

None

__hash__()[source]

Stable (when parameters are fixed) hash for DetectionTrace.

Return type:

int

__init__(*, name, parameters=<factory>)
Parameters:
Return type:

None

class pysatl_cpd.core.change_point_detector.ChangePointDetector(*, data_transformer=None)[source]

Bases: ABC, Generic

A detector with a uniform output - DetectionTrace.

Parameters:

data_transformer (Optional[IDataTransformer[Any, Any]]) – Optional transformer applied to incoming data before detection.

__init__(*, data_transformer=None)[source]
Parameters:

data_transformer (IDataTransformer[Any, Any] | None)

Return type:

None

abstract property description: ChangePointDetectorDescription

Return a static description of the detector.

Returns:

Description containing the detector name and parameters.

Return type:

ChangePointDetectorDescription

Raises:

NotImplementedError – Subclasses must implement this property.

detect(data)[source]

Apply the detector-level transformer and build a trace.

Parameters:

data (DataProvider[TypeVar(DataT), TypeVar(AnnotationT, bound= TimeseriesAnnotation)]) – Source data to run detection on.

Returns:

Trace containing the detection results.

Return type:

DetectionTrace

abstractmethod clone()[source]

Create an independent detector instance with the same configuration.

Returns:

A new detector instance identical in configuration but with no accumulated state.

Return type:

Self

Raises:

NotImplementedError – Subclasses must implement this method.