[−][src]Struct libsvm::model::Svm
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]
X: TryInto<SvmNodes, Error = Error>,
Y: AsRef<[f64]>,
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]
&self,
x: X,
y: Y,
n_folds: NonZeroUsize
) -> Result<Vec<f64>, Error> where
X: TryInto<SvmNodes, Error = Error>,
Y: AsRef<[f64]>,
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]
X: TryInto<SvmNodes, Error = Error>,
Predicts the output for given data.
Trait Implementations
Auto Trait Implementations
impl<State> RefUnwindSafe for Svm<State> where
State: RefUnwindSafe,
State: RefUnwindSafe,
impl<State> Send for Svm<State> where
State: Send,
State: Send,
impl<State> Sync for Svm<State> where
State: Sync,
State: Sync,
impl<State> Unpin for Svm<State> where
State: Unpin,
State: Unpin,
impl<State> UnwindSafe for Svm<State> where
State: UnwindSafe,
State: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,