pub struct ScoreAnswer {
pub score: f64,
pub legend: BTreeMap<String, String>,
pub probabilities: BTreeMap<String, f64>,
pub confidence: f64,
}Expand description
The typed answer to a DecisionQuestion::Score.
§Examples
use ironflow_core::decision::ScoreAnswer;
use std::collections::BTreeMap;
let a = ScoreAnswer {
score: 1.6,
legend: BTreeMap::from([("2".to_string(), "Very angry".to_string())]),
probabilities: BTreeMap::from([("2".to_string(), 0.65)]),
confidence: 0.78,
};
assert!(a.score > 1.5);Fields§
§score: f64Probability-weighted score across the levels.
legend: BTreeMap<String, String>Level index (as a string) -> description.
probabilities: BTreeMap<String, f64>Probability mass over each level index.
confidence: f64Calibrated confidence in [0, 1], derived from the distribution.
Trait Implementations§
Source§impl Clone for ScoreAnswer
impl Clone for ScoreAnswer
Source§impl Debug for ScoreAnswer
impl Debug for ScoreAnswer
Source§impl<'de> Deserialize<'de> for ScoreAnswer
impl<'de> Deserialize<'de> for ScoreAnswer
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 ScoreAnswer
impl PartialEq for ScoreAnswer
Source§impl Serialize for ScoreAnswer
impl Serialize for ScoreAnswer
impl StructuralPartialEq for ScoreAnswer
Auto Trait Implementations§
impl Freeze for ScoreAnswer
impl RefUnwindSafe for ScoreAnswer
impl Send for ScoreAnswer
impl Sync for ScoreAnswer
impl Unpin for ScoreAnswer
impl UnsafeUnpin for ScoreAnswer
impl UnwindSafe for ScoreAnswer
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