Skip to content

Orchestrator

polars_ts.anomaly_agents.orchestrator

AnomalyOrchestrator: chains detection agents over an AnomalyEnv.

AnomalyResult dataclass

Output of an AnomalyOrchestrator run.

AnomalyOrchestrator

Orchestrates anomaly detection agents over a time series.

At each step: 1. ZScoreAgent scores the current observation. 2. RollingStdAgent scores via median-deviation. 3. MADAgent scores via robust MAD. 4. ConsensusAgent aggregates via majority vote.

Parameters

window_size Observation window for the environment and agents. consensus_method Voting method for ConsensusAgent. z_threshold Z-score threshold for ZScoreAgent. std_threshold Threshold for RollingStdAgent. mad_threshold Threshold for MADAgent.

run(data, labels=None)

Run the multi-agent anomaly detection loop.

Parameters

data 1D array of time series values. labels Optional ground-truth labels for reward computation.

Returns

AnomalyResult