Enum ffsvm::Error

source ·
pub enum Error {
    AttributesUnordered {
        index: u32,
        value: f32,
        last_index: u32,
    },
    NoProbabilities,
    IterationsExceeded,
    NoGamma,
    NoCoef0,
    NoDegree,
    Parsing(String),
    MissingRequiredAttribute,
}
Expand description

Possible error types when classifying with one of the SVMs.

Variants§

§

AttributesUnordered

Fields

§index: u32

The index process that was not a direct successor of the previous index. Can be used for easier debugging the model file.

§value: f32

The value of the given index. Can be used for debugging in conjunction with index.

§last_index: u32

The last index processed. If everything were alright, then index should equal last_index + 1.

This can be emitted when creating a SVM from a ModelFile. For models generated by libSVM’s svm-train, the most common reason this occurs is skipping attributes. All attributes must be in sequential order 0, 1, 2, …, n. If they are not, this error will be emitted. For more details see the documentation provided in ModelFile.

§

NoProbabilities

This error can be emitted by Predict::predict_probability in case the model loaded by ModelFile was not trained with probability estimates (svm-train -b 1).

§

IterationsExceeded

Can be emitted by Predict::predict_probability when predicting probabilities and the internal iteration limit was exceeded.

§

NoGamma

If the model does not have a gamma set this error may be raised.

§

NoCoef0

If the model does not have a coef0 set this error may be raised.

§

NoDegree

If the model does not have a degree set this error may be raised.

§

Parsing(String)

Wrapper for internal parsing error when unifiying error handling.

§

MissingRequiredAttribute

A required attribute was not found.

Trait Implementations§

source§

impl Debug for Error

source§

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

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

impl From<ParseFloatError> for Error

source§

fn from(_e: ParseFloatError) -> Self

Converts to this type from the input type.
source§

impl From<ParseIntError> for Error

source§

fn from(_: ParseIntError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.