Skip to main content

oximedia_analytics/
lib.rs

1//! # oximedia-analytics
2//!
3//! Media engagement analytics for the OxiMedia Sovereign Media Framework.
4//!
5//! Provides viewer session tracking, audience retention curves, A/B testing,
6//! multi-armed bandits, cohort analysis, funnel analysis, real-time aggregation,
7//! time-series decomposition, EMA trend analysis, geo/device breakdowns,
8//! reservoir-sampled heatmaps, CTR tracking, and engagement scoring — pure Rust.
9
10pub mod ab_testing;
11pub mod anomaly;
12pub mod attribution;
13pub mod bandit;
14pub mod cohort;
15pub mod ctr;
16pub mod engagement;
17pub mod error;
18pub mod event_buffer;
19pub mod fingerprint;
20pub mod funnel;
21pub mod geo_device;
22pub mod heatmap;
23pub mod multivariate;
24pub mod percentile;
25pub mod quantile;
26pub mod realtime;
27pub mod recommendation;
28pub mod replay;
29pub mod retention;
30pub mod segment_retention;
31pub mod session;
32pub mod uniformity;
33pub mod weighted_retention;
34
35// ── Re-exports of key public types ─────────────────────────────────────────
36
37pub use ab_testing::{
38    assign_variant, bayesian_winner, winning_variant, winning_variant_with_alpha, AssignmentMethod,
39    BayesianAbResult, Experiment, ExperimentResults, OptimisationMetric, Variant, VariantMetrics,
40};
41pub use bandit::{BanditArm, BanditStrategy, MultiArmedBandit, RegretTracker};
42pub use cohort::{
43    build_cohort_matrix, Cohort, CohortAnalyzer, CohortDefinition, CohortMatrix,
44    CohortRetentionCell, CohortWindow, UserEvent, ViewerEvent,
45};
46pub use engagement::{
47    compute_engagement, decompose_time_series, exponential_moving_average, linear_regression_slope,
48    ContentEngagementScore, ContentRanker, DecomposedSeries, EmaConfig, EmaResult,
49    EngagementComponents, EngagementTrend, EngagementWeights, SeasonalPeriod, TrendDirection,
50};
51pub use error::AnalyticsError;
52pub use funnel::{
53    compute_funnel, compute_loyalty, predict_churn, ChurnAssessment, ChurnConfig, ChurnRisk,
54    FunnelAnalyzer, FunnelDefinition, FunnelMilestone, FunnelReport, FunnelResult, FunnelStep,
55    FunnelStepDef, LoyaltyComponents, LoyaltyScore, LoyaltyWeights, SessionEvent,
56};
57pub use geo_device::{
58    BreakdownAnalyzer, DeviceType, GeoDeviceReport, PeriodDelta, Region, SessionRecord,
59    SliceComparison, SliceMetrics, TimestampedRecord,
60};
61pub use quantile::{percentiles, TDigest};
62pub use realtime::{BucketMetrics, RealtimeEvent, SlidingWindowAggregator};
63pub use retention::{
64    average_view_duration, compare_to_benchmark, compute_retention, compute_retention_incremental,
65    compute_segment_retention, drop_off_points, re_watch_segments, ContentSegment,
66    IncrementalRetentionState, RetentionBenchmark, RetentionBucket, RetentionCurve,
67    SegmentRetentionResult,
68};
69pub use session::{
70    analyze_session, analyze_sessions_batch, attention_heatmap, build_playback_map,
71    reservoir_sampled_heatmap, HeatPoint, PlaybackEvent, PlaybackMap, ReservoirHeatmapConfig,
72    SampledHeatmap, SessionMetrics, ViewerSession,
73};