pub enum RillError {
Show 22 variants
DimensionMismatch {
expected: usize,
actual: usize,
},
EmptyFeatures,
InvalidWindowSize,
InvalidLearningRate(f64),
InvalidParameter {
name: &'static str,
value: f64,
},
NonFiniteValue {
field: &'static str,
value: f64,
},
InvalidProbability(f64),
InsufficientData,
IncompatibleStateVersion {
expected: u32,
actual: u32,
},
UnsortedFeatureIds,
DuplicateFeatureId(u64),
InvalidHashDimension(usize),
UnknownCategory(String),
MissingValue {
index: usize,
},
InvalidCapacity(usize),
InvalidSignificanceLevel(f64),
InvalidArmCount(usize),
InvalidEpsilon(f64),
InvalidArm {
expected: usize,
actual: usize,
},
InvalidReward(f64),
InvalidFeatureCount(usize),
InvalidState(String),
}Expand description
The unified error type returned by all RillML public APIs.
Variants§
DimensionMismatch
A feature slice did not match the expected dimension.
Fields
EmptyFeatures
An empty feature slice was provided where at least one feature is required.
InvalidWindowSize
A rolling window size of zero was provided.
InvalidLearningRate(f64)
A learning rate that is not strictly positive was provided.
InvalidParameter
A generic numeric parameter was invalid.
NonFiniteValue
A NaN or Infinity value was encountered.
Fields
InvalidProbability(f64)
A probability outside (0, 1) was provided.
InsufficientData
Not enough data has been observed to compute the requested quantity.
IncompatibleStateVersion
A serialized snapshot used an incompatible format version.
Fields
UnsortedFeatureIds
Sparse features were not sorted by FeatureId.
DuplicateFeatureId(u64)
Duplicate FeatureId encountered in sparse features.
InvalidHashDimension(usize)
FeatureHasher dimension is invalid (must be > 0).
UnknownCategory(String)
An unknown category was encountered by a categorical encoder.
MissingValue
A missing value (NaN) was encountered where it is not allowed.
InvalidCapacity(usize)
A window size or buffer capacity was invalid (must be > 0).
InvalidSignificanceLevel(f64)
A significance level or probability threshold was outside (0, 1).
InvalidArmCount(usize)
A bandit arm count was invalid (must be greater than zero).
InvalidEpsilon(f64)
An epsilon value for epsilon-greedy was outside [0, 1].
InvalidArm
A bandit arm index was out of range.
InvalidReward(f64)
A reward value was outside the valid range for the given bandit type.
InvalidFeatureCount(usize)
A feature count was invalid (must be greater than zero).
InvalidState(String)
A restored model violated one of its internal invariants.
Trait Implementations§
Source§impl Error for RillError
impl Error for RillError
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()