pub enum StatsError {
EmptyInput,
LengthMismatch {
scores: usize,
labels: usize,
},
NoPositiveLabels,
NoNegativeLabels,
InvalidBandwidth,
ZeroVariance,
}Expand description
Errors returned by the statistics routines for inputs where a metric is
undefined, rather than letting NaN propagate silently into a chart.
Variants§
EmptyInput
The input sample was empty.
LengthMismatch
scores and labels had different lengths.
NoPositiveLabels
The label vector contained no positive examples, so TPR / recall is undefined (division by zero positives).
NoNegativeLabels
The label vector contained no negative examples, so FPR is undefined (division by zero negatives). Only relevant to ROC.
InvalidBandwidth
A supplied bandwidth (or one derived from a degenerate sample) was not a finite, strictly-positive number.
ZeroVariance
A computation needing non-zero spread got a constant (zero-variance) input — e.g. Pearson correlation of a constant column, or a histogram of all-identical values.
Trait Implementations§
Source§impl Clone for StatsError
impl Clone for StatsError
Source§fn clone(&self) -> StatsError
fn clone(&self) -> StatsError
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 StatsError
impl Debug for StatsError
Source§impl Display for StatsError
impl Display for StatsError
impl Eq for StatsError
Source§impl Error for StatsError
impl Error for StatsError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for StatsError
impl PartialEq for StatsError
impl StructuralPartialEq for StatsError
Auto Trait Implementations§
impl Freeze for StatsError
impl RefUnwindSafe for StatsError
impl Send for StatsError
impl Sync for StatsError
impl Unpin for StatsError
impl UnsafeUnpin for StatsError
impl UnwindSafe for StatsError
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