Skip to main content

DriftLabelRecorder

Struct DriftLabelRecorder 

Source
pub struct DriftLabelRecorder { /* private fields */ }
Expand description

Drift label recorder.

Implementations§

Source§

impl DriftLabelRecorder

Source

pub fn new(config: DriftRecorderConfig, start_date: NaiveDate) -> Self

Create a new drift label recorder.

Source

pub fn is_enabled(&self) -> bool

Check if recording is enabled.

Source

pub fn record_regime_change( &mut self, regime: &RegimeChange, period: u32, _date: NaiveDate, )

Record a regime change event.

Source

pub fn record_statistical_drift( &mut self, adjustments: &DriftAdjustments, period: u32, )

Record statistical drift from drift adjustments.

Source

pub fn record_market_drift( &mut self, market_type: MarketEventType, period: u32, magnitude: f64, is_recession: bool, )

Record a market/economic drift event.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn events(&self) -> &[LabeledDriftEvent]

Get all recorded events.

Source

pub fn events_in_range( &self, start_period: u32, end_period: u32, ) -> Vec<&LabeledDriftEvent>

Get events in a specific period range.

Source

pub fn events_by_category(&self, category: &str) -> Vec<&LabeledDriftEvent>

Get events by category.

Source

pub fn event_count(&self) -> usize

Get total event count.

Source

pub fn export_to_csv(&self, path: &Path) -> Result<usize>

Export events to CSV file.

Source

pub fn export_to_json(&self, path: &Path) -> Result<usize>

Export events to JSON file.

Source

pub fn summary(&self) -> DriftRecorderSummary

Get summary statistics.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V