Skip to main content

sightloom_analysis/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2#![allow(clippy::cast_precision_loss)]
3//! Zone analytics, pattern mining, and backend-neutral anomaly events.
4
5#[cfg(feature = "alloc")]
6extern crate alloc;
7
8mod anchor;
9mod config;
10mod envelope;
11mod error;
12mod events;
13mod stats;
14mod zone;
15
16#[cfg(feature = "alloc")]
17mod anomaly;
18#[cfg(feature = "alloc")]
19mod input;
20#[cfg(feature = "alloc")]
21mod pattern;
22#[cfg(feature = "alloc")]
23mod pattern_miners;
24#[cfg(feature = "alloc")]
25mod stat_anomaly;
26
27pub use anchor::AnchorPolicy;
28pub use config::ZoneAnalyticsConfig;
29pub use envelope::{analytics_to_envelope, track_of};
30pub use error::AnalyticsError;
31pub use events::AnalyticsEvent;
32pub use stats::{day_of_week_ns, hour_of_day_ns, mean, median, stddev, z_score};
33pub use zone::ZoneAnalytics;
34
35#[cfg(feature = "alloc")]
36pub use anomaly::{AnomalyEvent, AnomalyReason, Severity};
37#[cfg(feature = "alloc")]
38pub use input::{AnalysisSeries, DurationSample, PairSample, RouteSample, TimedSubjectEvent};
39#[cfg(feature = "alloc")]
40pub use pattern::{PatternKind, PatternRecord};
41#[cfg(feature = "alloc")]
42pub use pattern_miners::{
43    mine_co_occurrence, mine_day_of_week, mine_dwell_distribution, mine_expected_absence,
44    mine_group_formation, mine_patterns, mine_route_sequences, mine_time_of_day,
45    mine_visit_periodicity,
46};
47#[cfg(feature = "alloc")]
48pub use stat_anomaly::{BaselineStats, StatAnomalyConfig, build_baseline, detect_statistical};