pub struct BrierScoreGate { /* private fields */ }Expand description
Gate that blocks decisions when calibration is poor.
Implementations§
Source§impl BrierScoreGate
impl BrierScoreGate
Sourcepub fn with_settings(
threshold: f64,
min_samples: usize,
block_action: DecisionAction,
) -> Self
pub fn with_settings( threshold: f64, min_samples: usize, block_action: DecisionAction, ) -> Self
Create a gate with custom settings.
Sourcepub fn record(&mut self, predicted_probability: f64, was_incompatible: bool)
pub fn record(&mut self, predicted_probability: f64, was_incompatible: bool)
Record a prediction outcome.
Sourcepub fn apply(&self, proposed_action: DecisionAction) -> GateDecision
pub fn apply(&self, proposed_action: DecisionAction) -> GateDecision
Apply the gate to a proposed action.
Returns the action unchanged if gate is open, or block_action if closed.
Sourcepub fn brier_score(&self) -> f64
pub fn brier_score(&self) -> f64
Get current Brier score.
Sourcepub fn metrics(&self) -> BrierScoreMetrics
pub fn metrics(&self) -> BrierScoreMetrics
Get detailed metrics.
Trait Implementations§
Source§impl Clone for BrierScoreGate
impl Clone for BrierScoreGate
Source§fn clone(&self) -> BrierScoreGate
fn clone(&self) -> BrierScoreGate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BrierScoreGate
impl Debug for BrierScoreGate
Auto Trait Implementations§
impl Freeze for BrierScoreGate
impl RefUnwindSafe for BrierScoreGate
impl Send for BrierScoreGate
impl Sync for BrierScoreGate
impl Unpin for BrierScoreGate
impl UnsafeUnpin for BrierScoreGate
impl UnwindSafe for BrierScoreGate
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