[][src]Struct libsvm::model::Svm

pub struct Svm<State> { /* fields omitted */ }

The SVM model.

Methods

impl Svm<Untrained>[src]

pub fn kind(&self) -> SvmKind[src]

pub fn fit<X, Y>(&self, x: X, y: Y) -> Result<Svm<Trained>, Error> where
    X: TryInto<SvmNodes, Error = Error>,
    Y: AsRef<[f64]>, 
[src]

Trains the model on given dataset.

pub fn cross_validate<X, Y>(
    &self,
    x: X,
    y: Y,
    n_folds: NonZeroUsize
) -> Result<Vec<f64>, Error> where
    X: TryInto<SvmNodes, Error = Error>,
    Y: AsRef<[f64]>, 
[src]

Runs cross validation on given data.

impl Svm<Trained>[src]

pub fn kind(&self) -> SvmKind[src]

Gets the type of the model.

pub fn nr_classes(&self) -> usize[src]

Gets the number of output classes.

pub fn labels(&self) -> Vec<usize>[src]

Gets the label indexes.

pub fn get_sv_indexes(&self) -> Vec<usize>[src]

Gets the support vector indexes in training data.

pub fn predict<X>(&self, x: X) -> Result<Vec<f64>, Error> where
    X: TryInto<SvmNodes, Error = Error>, 
[src]

Predicts the output for given data.

Trait Implementations

impl<State: Debug> Debug for Svm<State>[src]

impl FromStr for Svm<Trained>[src]

type Err = Error

The associated error which can be returned from parsing.

Auto Trait Implementations

impl<State> RefUnwindSafe for Svm<State> where
    State: RefUnwindSafe

impl<State> Send for Svm<State> where
    State: Send

impl<State> Sync for Svm<State> where
    State: Sync

impl<State> Unpin for Svm<State> where
    State: Unpin

impl<State> UnwindSafe for Svm<State> where
    State: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.