[][src]Type Definition ffsvm::SparseSVM

type SparseSVM = SVMCore<dyn KernelSparse, SparseMatrix<f32>, SparseVector<f32>, SparseVector<f64>>;

Use this to load any libSVM model with normal performance.

Methods

impl SparseSVM[src]

pub fn class_index_for_label(&self, label: u32) -> Option<usize>[src]

Finds the class index for a given label.

Description

This method takes a label as defined in the libSVM training model and returns the internal index where this label resides. The index equals Problem::probabilities index where that label's probability can be found.

Returns

If the label was found its index returned in the Option. Otherwise None is returned.

pub fn class_label_for_index(&self, index: usize) -> Option<u32>[src]

Returns the class label for a given index.

Description

The inverse of SVMCore::class_index_for_label, this function returns the class label associated with a certain internal index. The index equals the Problem's .probabilities index where a label's probability can be found.

Returns

If the index was found it is returned in the Option. Otherwise None is returned.

Trait Implementations

impl<'a, 'b> TryFrom<&'a str> for SparseSVM[src]

type Error = Error

The type returned in the event of a conversion error.