pub struct SparseSVM { /* private fields */ }
Expand description
Implementations§
source§impl SparseSVM
impl SparseSVM
sourcepub fn class_index_for_label(&self, label: i32) -> Option<usize>
pub fn class_index_for_label(&self, label: i32) -> Option<usize>
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.
sourcepub fn class_label_for_index(&self, index: usize) -> Option<i32>
pub fn class_label_for_index(&self, index: usize) -> Option<i32>
Returns the class label for a given index.
§Description
The inverse of SparseSVM::class_index_for_label
, this function returns the class label
associated with a certain internal index. The index equals the Problem::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.
sourcepub const fn attributes(&self) -> usize
pub const fn attributes(&self) -> usize
Returns number of attributes, reflecting the libSVM model.
Trait Implementations§
source§impl<'a> From<&'a SparseSVM> for SparseProblem
impl<'a> From<&'a SparseSVM> for SparseProblem
Auto Trait Implementations§
impl Freeze for SparseSVM
impl !RefUnwindSafe for SparseSVM
impl Send for SparseSVM
impl Sync for SparseSVM
impl Unpin for SparseSVM
impl !UnwindSafe for SparseSVM
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more