Struct rusty_machine::learning::svm::SVM [] [src]

pub struct SVM<K: Kernel> {
    pub optim_iters: usize,
    // some fields omitted
}

Support Vector Machine

Fields

optim_iters: usize

Number of iterations for training.

Methods

impl<K: Kernel> SVM<K>
[src]

fn new(ker: K, lambda: f64) -> SVM<K>

Constructs an untrained SVM with specified kernel and lambda which determins the hardness of the margin.

Examples

use rusty_machine::learning::svm::SVM;
use rusty_machine::learning::toolkit::kernel::SquaredExp;

let _ = SVM::new(SquaredExp::default(), 0.3);

Trait Implementations

impl<K: Debug + Kernel> Debug for SVM<K>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Default for SVM<SquaredExp>
[src]

The default Support Vector Machine.

The defaults are:

fn default() -> SVM<SquaredExp>

Returns the "default value" for a type. Read more

impl<K: Kernel> SupModel<Matrix<f64>, Vector<f64>> for SVM<K>
[src]

Train the model using the Pegasos algorithm and predict the model output from new data.

fn predict(&self, inputs: &Matrix<f64>) -> Vector<f64>

Predict output from inputs.

fn train(&mut self, inputs: &Matrix<f64>, targets: &Vector<f64>)

Train the model using inputs and targets.