pub enum ModelSelectionError {
NotEnoughSamples {
needed: usize,
got: usize,
},
EmptyClass,
EmptyGroup,
InvalidSplitCount {
msg: String,
},
InsufficientTrainWindow {
msg: String,
},
ShapeMismatch {
expected: usize,
got: usize,
},
}Expand description
Errors returned by splitters and evaluation utilities.
The library follows a deliberate policy on degenerate inputs (mirroring the
convention used across the sibling imbalance-rs crate):
- Warn and adjust where a sane fallback exists — e.g. a
StratifiedKFoldclass smaller thann_splitsis distributed across as many folds as it can fill, with a warning on stderr, rather than aborting the whole split. - Hard-error where there is no meaningful fallback — e.g. a
TimeSeriesSplitasked for more splits than the data can supply a valid train/test window for.
Variants§
NotEnoughSamples
Fewer samples than are needed to form the requested splits.
Fields
EmptyClass
A class label had no samples where at least one was required.
EmptyGroup
A group had no samples where at least one was required.
InvalidSplitCount
The requested number of splits is invalid (must be >= 2, and no larger
than the number of samples / groups the splitter partitions over).
InsufficientTrainWindow
TimeSeriesSplit could not carve
out a training window large enough for every requested split.
ShapeMismatch
Two inputs that had to agree on length did not (e.g. a stored label
array whose length differs from n_samples passed to split).
Trait Implementations§
Source§impl Clone for ModelSelectionError
impl Clone for ModelSelectionError
Source§fn clone(&self) -> ModelSelectionError
fn clone(&self) -> ModelSelectionError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModelSelectionError
impl Debug for ModelSelectionError
Source§impl Display for ModelSelectionError
impl Display for ModelSelectionError
impl Eq for ModelSelectionError
Source§impl Error for ModelSelectionError
impl Error for ModelSelectionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for ModelSelectionError
impl PartialEq for ModelSelectionError
impl StructuralPartialEq for ModelSelectionError
Auto Trait Implementations§
impl Freeze for ModelSelectionError
impl RefUnwindSafe for ModelSelectionError
impl Send for ModelSelectionError
impl Sync for ModelSelectionError
impl Unpin for ModelSelectionError
impl UnsafeUnpin for ModelSelectionError
impl UnwindSafe for ModelSelectionError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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