Skip to main content

RillError

Enum RillError 

Source
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

§expected: usize

The expected number of features.

§actual: usize

The actual number of features provided.

§

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.

Fields

§name: &'static str

The name of the parameter.

§value: f64

The invalid value.

§

NonFiniteValue

A NaN or Infinity value was encountered.

Fields

§field: &'static str

Which field or quantity the bad value belongs to.

§value: f64

The offending value.

§

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

§expected: u32

The format version the loader expects.

§actual: u32

The format version found in the snapshot.

§

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.

Fields

§index: usize

The index of the missing value.

§

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.

Fields

§expected: usize

The number of arms (upper bound).

§actual: usize

The offending arm index.

§

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 Debug for RillError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for RillError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for RillError

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V