pub struct DriftLabelRecorder { /* private fields */ }Expand description
Drift label recorder.
Implementations§
Source§impl DriftLabelRecorder
impl DriftLabelRecorder
Sourcepub fn new(config: DriftRecorderConfig, start_date: NaiveDate) -> Self
pub fn new(config: DriftRecorderConfig, start_date: NaiveDate) -> Self
Create a new drift label recorder.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if recording is enabled.
Sourcepub fn record_regime_change(
&mut self,
regime: &RegimeChange,
period: u32,
_date: NaiveDate,
)
pub fn record_regime_change( &mut self, regime: &RegimeChange, period: u32, _date: NaiveDate, )
Record a regime change event.
Sourcepub fn record_statistical_drift(
&mut self,
adjustments: &DriftAdjustments,
period: u32,
)
pub fn record_statistical_drift( &mut self, adjustments: &DriftAdjustments, period: u32, )
Record statistical drift from drift adjustments.
Sourcepub fn record_market_drift(
&mut self,
market_type: MarketEventType,
period: u32,
magnitude: f64,
is_recession: bool,
)
pub fn record_market_drift( &mut self, market_type: MarketEventType, period: u32, magnitude: f64, is_recession: bool, )
Record a market/economic drift event.
Sourcepub fn record_process_drift(
&mut self,
process_type: &str,
related_event_id: &str,
period: u32,
magnitude: f64,
affected_processes: Vec<String>,
)
pub fn record_process_drift( &mut self, process_type: &str, related_event_id: &str, period: u32, magnitude: f64, affected_processes: Vec<String>, )
Record a process evolution drift event.
Sourcepub fn record_technology_drift(
&mut self,
transition_type: &str,
related_event_id: &str,
period: u32,
magnitude: f64,
systems: Vec<String>,
current_phase: Option<&str>,
)
pub fn record_technology_drift( &mut self, transition_type: &str, related_event_id: &str, period: u32, magnitude: f64, systems: Vec<String>, current_phase: Option<&str>, )
Record a technology transition drift event.
Sourcepub fn record_temporal_drift(
&mut self,
shift_type: TemporalShiftType,
period: u32,
magnitude: f64,
affected_field: Option<&str>,
description: Option<&str>,
)
pub fn record_temporal_drift( &mut self, shift_type: TemporalShiftType, period: u32, magnitude: f64, affected_field: Option<&str>, description: Option<&str>, )
Record a temporal pattern drift event.
Sourcepub fn record_categorical_drift(
&mut self,
shift_type: CategoricalShiftType,
affected_field: &str,
period: u32,
proportions_before: HashMap<String, f64>,
proportions_after: HashMap<String, f64>,
)
pub fn record_categorical_drift( &mut self, shift_type: CategoricalShiftType, affected_field: &str, period: u32, proportions_before: HashMap<String, f64>, proportions_after: HashMap<String, f64>, )
Record a categorical drift event.
Sourcepub fn events(&self) -> &[LabeledDriftEvent]
pub fn events(&self) -> &[LabeledDriftEvent]
Get all recorded events.
Sourcepub fn events_in_range(
&self,
start_period: u32,
end_period: u32,
) -> Vec<&LabeledDriftEvent>
pub fn events_in_range( &self, start_period: u32, end_period: u32, ) -> Vec<&LabeledDriftEvent>
Get events in a specific period range.
Sourcepub fn events_by_category(&self, category: &str) -> Vec<&LabeledDriftEvent>
pub fn events_by_category(&self, category: &str) -> Vec<&LabeledDriftEvent>
Get events by category.
Sourcepub fn event_count(&self) -> usize
pub fn event_count(&self) -> usize
Get total event count.
Sourcepub fn export_to_csv(&self, path: &Path) -> Result<usize>
pub fn export_to_csv(&self, path: &Path) -> Result<usize>
Export events to CSV file.
Sourcepub fn export_to_json(&self, path: &Path) -> Result<usize>
pub fn export_to_json(&self, path: &Path) -> Result<usize>
Export events to JSON file.
Sourcepub fn summary(&self) -> DriftRecorderSummary
pub fn summary(&self) -> DriftRecorderSummary
Get summary statistics.
Auto Trait Implementations§
impl Freeze for DriftLabelRecorder
impl RefUnwindSafe for DriftLabelRecorder
impl Send for DriftLabelRecorder
impl Sync for DriftLabelRecorder
impl Unpin for DriftLabelRecorder
impl UnwindSafe for DriftLabelRecorder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more