use thiserror::Error;
#[derive(Debug, Error, Clone, PartialEq, Eq)]
pub enum ModelSelectionError {
#[error("not enough samples: need at least {needed}, got {got}")]
NotEnoughSamples {
needed: usize,
got: usize,
},
#[error("class has no samples but was required to be non-empty")]
EmptyClass,
#[error("group has no samples but was required to be non-empty")]
EmptyGroup,
#[error("invalid split count: {msg}")]
InvalidSplitCount {
msg: String,
},
#[error("insufficient training window: {msg}")]
InsufficientTrainWindow {
msg: String,
},
#[error("shape mismatch: expected length {expected}, got {got}")]
ShapeMismatch {
expected: usize,
got: usize,
},
}
pub type Result<T> = std::result::Result<T, ModelSelectionError>;