pub struct SampleResult<'a> { /* private fields */ }Expand description
The results of regressing a single sample.
Implementations§
Source§impl<'a> SampleResult<'a>
impl<'a> SampleResult<'a>
Sourcepub fn from_adhoc(sample_scores: ArrayView1<'a, f64>) -> Self
pub fn from_adhoc(sample_scores: ArrayView1<'a, f64>) -> Self
Create a SampleResult from raw scores, useful for code-reuse during training.
Sourcepub fn into_scores(self) -> ArrayView1<'a, f64>
pub fn into_scores(self) -> ArrayView1<'a, f64>
Convert the SampleResult into its underlying raw scores.
Sourcepub fn sorted_classes(&self) -> Array1<usize>
pub fn sorted_classes(&self) -> Array1<usize>
An array where every classification index sorted by most to least likely. If you are only interested in the winning classification, simply take the first entry.
Resolving the actual scores or human-readable labels of these classification indices is left to the caller (usually Model).
Sourcepub fn probabilities(&self) -> Array1<f64>
pub fn probabilities(&self) -> Array1<f64>
An array of probabilities between 0..1 where each value corresponds with the relative probabilities of each classification rather than the absolute score returned by the result matrix. Note that the “probabilities” returned do not correspond to a rigorous mathematical metric, but simply match an intuitive notion of probability. This is generally only useful for reporting to humans.
Auto Trait Implementations§
impl<'a> Freeze for SampleResult<'a>
impl<'a> RefUnwindSafe for SampleResult<'a>
impl<'a> Send for SampleResult<'a>
impl<'a> Sync for SampleResult<'a>
impl<'a> Unpin for SampleResult<'a>
impl<'a> UnsafeUnpin for SampleResult<'a>
impl<'a> UnwindSafe for SampleResult<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more