quantrs2_device/ml_optimization/
monitoring.rs

1//! ML Monitoring Configuration Types
2
3use serde::{Deserialize, Serialize};
4use std::collections::HashMap;
5
6/// ML monitoring configuration
7#[derive(Debug, Clone, Serialize, Deserialize)]
8pub struct MLMonitoringConfig {
9    /// Real-time monitoring
10    pub enable_real_time_monitoring: bool,
11    /// Performance tracking
12    pub performance_tracking: bool,
13    /// Model drift detection
14    pub drift_detection: DriftDetectionConfig,
15    /// Anomaly detection
16    pub anomaly_detection: bool,
17    /// Alert thresholds
18    pub alert_thresholds: HashMap<String, f64>,
19}
20
21/// Drift detection configuration
22#[derive(Debug, Clone, Serialize, Deserialize)]
23pub struct DriftDetectionConfig {
24    /// Enable drift detection
25    pub enable_detection: bool,
26    /// Detection methods
27    pub detection_methods: Vec<DriftDetectionMethod>,
28    /// Detection window size
29    pub window_size: usize,
30    /// Significance threshold
31    pub significance_threshold: f64,
32}
33
34/// Drift detection methods
35#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
36pub enum DriftDetectionMethod {
37    ADWIN,
38    DDM,
39    EDDM,
40    PageHinkley,
41    KolmogorovSmirnov,
42    PopulationStabilityIndex,
43}