pub struct ValidationSample {
pub ground_truth: InferredOwnership,
pub rule_prediction: InferredOwnership,
pub ml_prediction: InferredOwnership,
pub ml_confidence: f64,
}Expand description
A single validation sample for threshold tuning.
Fields§
§ground_truth: InferredOwnershipGround truth ownership
rule_prediction: InferredOwnershipRule-based prediction
ml_prediction: InferredOwnershipML prediction
ml_confidence: f64ML confidence score (0.0 - 1.0)
Implementations§
Source§impl ValidationSample
impl ValidationSample
Sourcepub fn new(
ground_truth: InferredOwnership,
rule_prediction: InferredOwnership,
ml_prediction: InferredOwnership,
ml_confidence: f64,
) -> Self
pub fn new( ground_truth: InferredOwnership, rule_prediction: InferredOwnership, ml_prediction: InferredOwnership, ml_confidence: f64, ) -> Self
Create a new validation sample.
Sourcepub fn rule_correct(&self) -> bool
pub fn rule_correct(&self) -> bool
Check if rule prediction is correct.
Sourcepub fn ml_correct(&self) -> bool
pub fn ml_correct(&self) -> bool
Check if ML prediction is correct.
Sourcepub fn hybrid_prediction(&self, threshold: f64) -> InferredOwnership
pub fn hybrid_prediction(&self, threshold: f64) -> InferredOwnership
Get the hybrid prediction at a given threshold.
Sourcepub fn hybrid_correct(&self, threshold: f64) -> bool
pub fn hybrid_correct(&self, threshold: f64) -> bool
Check if hybrid prediction is correct at given threshold.
Trait Implementations§
Source§impl Clone for ValidationSample
impl Clone for ValidationSample
Source§fn clone(&self) -> ValidationSample
fn clone(&self) -> ValidationSample
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 ValidationSample
impl Debug for ValidationSample
Source§impl<'de> Deserialize<'de> for ValidationSample
impl<'de> Deserialize<'de> for ValidationSample
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 ValidationSample
impl RefUnwindSafe for ValidationSample
impl Send for ValidationSample
impl Sync for ValidationSample
impl Unpin for ValidationSample
impl UnwindSafe for ValidationSample
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