Expand description
Zone analytics, pattern mining, and backend-neutral anomaly events.
Structs§
- Analysis
Series - Bundle of host-prepared series used by miners/detectors.
- Anomaly
Event - Backend-neutral anomaly event exposed to host products.
- Anomaly
Score Sample - One score used for FAR calibration (higher = more anomalous).
- Baseline
Stats - Baseline statistics learned from historical series.
- Camera
Graph - Sparse camera graph used for impossible-hop checks.
- Camera
Hop - One observed subject hop between cameras.
- Duration
Sample - One dwell / visit duration sample.
- FarCalibration
Report - Result of calibrating a score threshold to a target false-alarm rate.
- Graph
Anomaly Config - Configuration for relational / graph anomaly detection.
- Graph
Baseline - Relational baseline histograms.
- Graph
Edge - Directed camera hop constraint (analysis-local; mirrors re-id topology shape).
- Graph
Relational Detector - Graph / relational detector implementing
AnomalyDetector. - Isolation
Forest Config - Isolation Forest configuration.
- Isolation
Forest Detector - Fitted isolation forest on dense feature rows.
- OcSvm
Config - One-Class SVM configuration (RBF novelty detector).
- OcSvm
Detector - Fitted RBF One-Class model on dense feature rows.
- Pair
Sample - One co-occurrence pair observation.
- Pattern
Record - Stored pattern record.
- Quantum
Stub Config - Configuration for the classical quantum-shaped stub.
- Quantum
Stub Detector - Classical stub implementing
AnomalyDetectorwith a quantum-shaped API. - Route
Sample - One ordered zone route for a subject.
- Scoped
Baseline Store - Store of global + per-subject + per-source baselines.
- Stat
Anomaly Config - Configuration for the statistical anomaly detector.
- Statistical
Anomaly Detector - Statistical z-score backend implementing
AnomalyDetector. - Timed
Subject Event - One timed subject observation (appearance start, visit start, etc.).
- Zone
Analytics - Polygon zone analytics with hysteresis, dwell, and occupancy.
- Zone
Analytics Config - Configuration for
crate::ZoneAnalytics.
Enums§
- Analytics
Error - An error produced by zone analytics.
- Analytics
Event - Analytics events emitted by enhanced zone monitors.
- Anchor
Policy - Which point of a detection is tested against a zone.
- Anomaly
Reason - Machine-readable anomaly reason codes (host maps to UI copy).
- Baseline
Scope - Which scope a baseline row belongs to.
- Pattern
Kind - Pattern kind tags.
- Severity
- Anomaly severity for host presentation.
Traits§
- Anomaly
Detector - Backend-neutral anomaly detector.
Functions§
- analytics_
to_ envelope - Builds an
EventEnvelopefrom an analytics event. - apply_
far_ to_ stat_ config - Maps a FAR calibration result into a statistical z-threshold config.
- build_
baseline - Builds baseline stats from historical series.
- build_
graph_ baseline - Builds relational histograms from a history series.
- calibrate_
far_ from_ series - End-to-end: baseline fit on history → score history → FAR threshold.
- calibrate_
far_ threshold - Calibrates a threshold so ≈
target_farof normal scores fire. - change_
point_ cusum - Simple CUSUM-style change-point score: max running deviation of prefix means.
- day_
of_ week_ ns - Day of week
0..7(0 = epoch day alignment) from nanoseconds. - detect_
graph_ anomalies - Detects relational anomalies in
liveagainstbaseline+ optional graph. - detect_
statistical - Detects statistical anomalies in
seriesagainstbaseline. - detect_
statistical_ scoped - Detects anomalies using the most specific baseline available per sample.
- extract_
camera_ hops - Extracts consecutive cross-camera hops from timed subject events.
- hour_
of_ day_ ns - Hour of day
0..24from nanoseconds since an arbitrary epoch. - mad
- Median absolute deviation from the median (
median(|x - med|)). - mean
- Arithmetic mean of a non-empty finite sample.
- median
- Median of a non-empty sample (sorts a copy into
scratch). - mine_
co_ occurrence - Frequent co-occurring subject pairs.
- mine_
day_ of_ week - Day-of-week concentration per subject.
- mine_
dwell_ distribution - Dwell distribution summary (mean duration) as a pattern per subject.
- mine_
event_ before_ event - Mines ordered event-kind pairs (A then B) per subject.
- mine_
expected_ absence - Expected absence: long median gap is stored as the expected quiet period.
- mine_
group_ formation - Group formation: subjects that co-occur with many peers.
- mine_
patterns - Mines all built-in patterns and returns them with sequential ids from
next_id. - mine_
route_ sequences - Most frequent route n-gram (full sequence hash as tag).
- mine_
time_ of_ day - Time-of-day concentration per subject (and global when subject is missing).
- mine_
visit_ periodicity - Visit periodicity from inter-arrival gaps (median gap + regularity).
- robust_
z_ score - Robust z-score using median and MAD (
0.6745 * |x-med| / MAD). - score_
series_ vs_ baseline - Scores dwell/gap/hour absolute z-values on
seriesvsbaseline(for FAR). - stddev
- Population standard deviation (
sqrt(mean((x-mu)^2))). - track_
of - Convenience for envelopes that already know their track id from the event.
- z_score
- Absolute z-score
|x - mu| / sigma(0 when sigma is ~0).