Skip to main content

RetrainOrchestrator

Struct RetrainOrchestrator 

Source
pub struct RetrainOrchestrator<M, D>{ /* private fields */ }
Expand description

Automatic retraining orchestrator

Monitors predictions for drift and triggers retraining when needed.

Implementations§

Source§

impl<M> RetrainOrchestrator<M, ADWIN>
where M: OnlineLearner + Debug,

Source

pub fn new(model: M, n_features: usize) -> RetrainOrchestrator<M, ADWIN>

Create an orchestrator with ADWIN detector (recommended default)

Source§

impl<M, D> RetrainOrchestrator<M, D>

Source

pub fn with_detector( model: M, detector: D, n_features: usize, ) -> RetrainOrchestrator<M, D>

Create with custom drift detector

Source

pub fn with_config( model: M, detector: D, n_features: usize, config: RetrainConfig, ) -> RetrainOrchestrator<M, D>

Create with custom configuration

Source

pub fn observe( &mut self, features: &[f64], target: &[f64], prediction: &[f64], ) -> Result<ObserveResult, AprenderError>

Process new sample and handle drift

§Arguments
  • features - Input features
  • target - True target value
  • prediction - Model’s prediction
§Returns

Result indicating what action was taken

Source

pub fn model(&self) -> &M

Get reference to the model

Source

pub fn model_mut(&mut self) -> &mut M

Get mutable reference to the model

Source

pub fn detector(&self) -> &D

Get reference to the drift detector

Source

pub fn stats(&self) -> &OrchestratorStats

Get orchestrator statistics

Source

pub fn drift_status(&self) -> DriftStatus

Get current drift status

Source

pub fn force_retrain(&mut self) -> Result<(), AprenderError>

Force a retrain (useful for manual triggers)

Source

pub fn buffer_size(&self) -> usize

Get buffer size

Source

pub fn should_retrain(&self) -> bool

Check if retraining is recommended

Source

pub fn config(&self) -> &RetrainConfig

Get configuration

Trait Implementations§

Source§

impl<M, D> Debug for RetrainOrchestrator<M, D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<M, D> Freeze for RetrainOrchestrator<M, D>
where M: Freeze, D: Freeze,

§

impl<M, D> RefUnwindSafe for RetrainOrchestrator<M, D>

§

impl<M, D> Send for RetrainOrchestrator<M, D>
where M: Send,

§

impl<M, D> Sync for RetrainOrchestrator<M, D>
where M: Sync,

§

impl<M, D> Unpin for RetrainOrchestrator<M, D>
where M: Unpin, D: Unpin,

§

impl<M, D> UnsafeUnpin for RetrainOrchestrator<M, D>
where M: UnsafeUnpin, D: UnsafeUnpin,

§

impl<M, D> UnwindSafe for RetrainOrchestrator<M, D>
where M: UnwindSafe, D: UnwindSafe,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,