pub struct ModelVersionManager { /* private fields */ }Expand description
Model version manager with rollback capability.
Implementations§
Source§impl ModelVersionManager
impl ModelVersionManager
Sourcepub fn with_thresholds(thresholds: QualityThresholds) -> Self
pub fn with_thresholds(thresholds: QualityThresholds) -> Self
Create with custom thresholds.
Sourcepub fn with_max_history(self, max: usize) -> Self
pub fn with_max_history(self, max: usize) -> Self
Set maximum history size.
Sourcepub fn active_version(&self) -> Option<&ModelEntry>
pub fn active_version(&self) -> Option<&ModelEntry>
Get current active version.
Sourcepub fn versions(&self) -> impl Iterator<Item = &ModelEntry>
pub fn versions(&self) -> impl Iterator<Item = &ModelEntry>
Get all versions.
Sourcepub fn version_count(&self) -> usize
pub fn version_count(&self) -> usize
Get version count.
Sourcepub fn thresholds(&self) -> &QualityThresholds
pub fn thresholds(&self) -> &QualityThresholds
Get quality thresholds.
Sourcepub fn register_version(&mut self, entry: ModelEntry) -> Result<bool, String>
pub fn register_version(&mut self, entry: ModelEntry) -> Result<bool, String>
Register a new model version.
Returns Ok(true) if version was activated, Ok(false) if registered but not activated (due to quality issues), or Err if registration failed.
Sourcepub fn rollback(
&mut self,
reason: impl Into<String>,
) -> Result<RollbackResult, String>
pub fn rollback( &mut self, reason: impl Into<String>, ) -> Result<RollbackResult, String>
Rollback to the previous version.
Sourcepub fn rollback_to(
&mut self,
target: &ModelVersion,
reason: impl Into<String>,
) -> Result<RollbackResult, String>
pub fn rollback_to( &mut self, target: &ModelVersion, reason: impl Into<String>, ) -> Result<RollbackResult, String>
Rollback to a specific version.
Sourcepub fn rollback_history(&self) -> &[RollbackResult]
pub fn rollback_history(&self) -> &[RollbackResult]
Get rollback history.
Sourcepub fn check_quality(
&self,
current_metrics: &ModelQualityMetrics,
) -> Option<String>
pub fn check_quality( &self, current_metrics: &ModelQualityMetrics, ) -> Option<String>
Check if current model needs rollback based on new metrics.
Implements Jidoka (stop the line) principle.
Sourcepub fn auto_rollback_if_needed(
&mut self,
current_metrics: &ModelQualityMetrics,
) -> Option<RollbackResult>
pub fn auto_rollback_if_needed( &mut self, current_metrics: &ModelQualityMetrics, ) -> Option<RollbackResult>
Auto-rollback if quality check fails.
Sourcepub fn to_markdown(&self) -> String
pub fn to_markdown(&self) -> String
Generate markdown report.
Trait Implementations§
Source§impl Clone for ModelVersionManager
impl Clone for ModelVersionManager
Source§fn clone(&self) -> ModelVersionManager
fn clone(&self) -> ModelVersionManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelVersionManager
impl Debug for ModelVersionManager
Source§impl Default for ModelVersionManager
impl Default for ModelVersionManager
Source§impl<'de> Deserialize<'de> for ModelVersionManager
impl<'de> Deserialize<'de> for ModelVersionManager
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ModelVersionManager
impl RefUnwindSafe for ModelVersionManager
impl Send for ModelVersionManager
impl Sync for ModelVersionManager
impl Unpin for ModelVersionManager
impl UnwindSafe for ModelVersionManager
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