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 UnsafeUnpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.