#[non_exhaustive]pub struct ScoreAnswer {
pub score: f64,
pub confidence: f64,
pub legend: BTreeMap<u32, Value>,
pub probabilities: BTreeMap<u32, f64>,
}Expand description
An expected score with its rubric and distribution.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.score: f64Probability-weighted level; may fall between levels.
confidence: f64Certainty derived from the distribution, 0 to 1.
legend: BTreeMap<u32, Value>Level index → the description you supplied.
probabilities: BTreeMap<u32, f64>Level index → probability.
Implementations§
Source§impl ScoreAnswer
impl ScoreAnswer
Sourcepub fn most_likely_level(&self) -> Option<u32>
pub fn most_likely_level(&self) -> Option<u32>
The single most likely level (argmax of probabilities), as opposed to the weighted score.
Sourcepub fn rounded_level(&self) -> u32
pub fn rounded_level(&self) -> u32
score rounded to the nearest level.
Trait Implementations§
Source§impl Clone for ScoreAnswer
impl Clone for ScoreAnswer
Source§fn clone(&self) -> ScoreAnswer
fn clone(&self) -> ScoreAnswer
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 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
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