pub struct LossMatrixCalibrator { /* private fields */ }Expand description
Calibrator that applies Bayesian shrinkage to loss observations.
Implementations§
Source§impl LossMatrixCalibrator
impl LossMatrixCalibrator
Sourcepub fn with_priors(
prior_false_negative: BayesianShrinkagePrior,
prior_validate_cost: BayesianShrinkagePrior,
prior_false_positive: BayesianShrinkagePrior,
) -> Self
pub fn with_priors( prior_false_negative: BayesianShrinkagePrior, prior_validate_cost: BayesianShrinkagePrior, prior_false_positive: BayesianShrinkagePrior, ) -> Self
Create a calibrator with custom priors.
Sourcepub fn observe(&mut self, obs: &LossObservation)
pub fn observe(&mut self, obs: &LossObservation)
Record an observation.
Sourcepub fn observe_batch(&mut self, observations: &[LossObservation])
pub fn observe_batch(&mut self, observations: &[LossObservation])
Record multiple observations.
Sourcepub fn calibrate(&self) -> CalibratedLossMatrix
pub fn calibrate(&self) -> CalibratedLossMatrix
Produce a calibrated loss matrix using current observations.
Sourcepub fn samples_for_confidence(
_prior: &BayesianShrinkagePrior,
threshold: f64,
) -> usize
pub fn samples_for_confidence( _prior: &BayesianShrinkagePrior, threshold: f64, ) -> usize
Minimum samples needed before shrinkage weight exceeds threshold.
Returns the sample count n where w >= threshold, assuming empirical variance equals a reference variance (prior_variance by default).
Sourcepub fn sample_counts(&self) -> LossSampleCounts
pub fn sample_counts(&self) -> LossSampleCounts
Get current sample counts.
Trait Implementations§
Source§impl Clone for LossMatrixCalibrator
impl Clone for LossMatrixCalibrator
Source§fn clone(&self) -> LossMatrixCalibrator
fn clone(&self) -> LossMatrixCalibrator
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 LossMatrixCalibrator
impl Debug for LossMatrixCalibrator
Auto Trait Implementations§
impl Freeze for LossMatrixCalibrator
impl RefUnwindSafe for LossMatrixCalibrator
impl Send for LossMatrixCalibrator
impl Sync for LossMatrixCalibrator
impl Unpin for LossMatrixCalibrator
impl UnsafeUnpin for LossMatrixCalibrator
impl UnwindSafe for LossMatrixCalibrator
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