pub enum ClassificationAnswer {
Noul {
probability: f64,
},
Choice {
selected: String,
probabilities: BTreeMap<String, f64>,
confidence: f64,
},
Score {
score: f64,
probabilities: BTreeMap<usize, f64>,
confidence: f64,
},
}Expand description
One typed answer.
Variants§
Noul
Probability that the answer is yes, 0..=1.
A value near 0.5 means yes and no are near-equally likely — not medium intensity.
Choice
The selected option and the distribution it came from.
Fields
Score
A probability-weighted position across the levels.
Implementations§
Source§impl ClassificationAnswer
impl ClassificationAnswer
Sourcepub fn probability_yes(&self) -> Option<f64>
pub fn probability_yes(&self) -> Option<f64>
Probability of yes, for a noul answer.
Sourcepub fn confidence(&self) -> Option<f64>
pub fn confidence(&self) -> Option<f64>
Distribution concentration, for the two primitives that report it.
Sourcepub fn probability_at_or_above(&self, level: usize) -> Option<f64>
pub fn probability_at_or_above(&self, level: usize) -> Option<f64>
Total probability mass at level or above, for a score answer.
This is the reading that an “any serious hit” rule needs: a bimodal answer that is probably fine and possibly severe must not average into fine.
Trait Implementations§
Source§impl Clone for ClassificationAnswer
impl Clone for ClassificationAnswer
Source§fn clone(&self) -> ClassificationAnswer
fn clone(&self) -> ClassificationAnswer
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 ClassificationAnswer
impl Debug for ClassificationAnswer
Source§impl<'de> Deserialize<'de> for ClassificationAnswer
impl<'de> Deserialize<'de> for ClassificationAnswer
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
Source§impl PartialEq for ClassificationAnswer
impl PartialEq for ClassificationAnswer
Source§impl Serialize for ClassificationAnswer
impl Serialize for ClassificationAnswer
impl StructuralPartialEq for ClassificationAnswer
Auto Trait Implementations§
impl Freeze for ClassificationAnswer
impl RefUnwindSafe for ClassificationAnswer
impl Send for ClassificationAnswer
impl Sync for ClassificationAnswer
impl Unpin for ClassificationAnswer
impl UnsafeUnpin for ClassificationAnswer
impl UnwindSafe for ClassificationAnswer
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