pub struct SvmValidParams<F: Float, T> { /* private fields */ }
Expand description

SVM Hyperparameters

The SVM fitting process can be controlled in different ways. For classification the C and Nu parameters control the ratio of support vectors and accuracy, eps controls the required precision. After setting the desired parameters a model can be fitted by calling fit.

You can specify the expected return type with the turbofish syntax. If you want to enable Platt-Scaling for proper probability values, then use:

use linfa_svm::Svm;
use linfa::dataset::Pr;
let model = Svm::<f64, Pr>::params();

or bool if you only wants to know the binary decision:

use linfa_svm::Svm;
let model = Svm::<f64, bool>::params();

Example

use linfa_svm::Svm;
let model = Svm::<_, bool>::params()
    .eps(0.1f64)
    .shrinking(true)
    .nu_weight(0.1)
    .fit(&dataset);

Implementations§

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.