Struct linfa_svm::hyperparams::SvmValidParams[][src]

pub struct SvmValidParams<F: Float, T> { /* fields omitted */ }
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

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

Performs the conversion.

Performs the conversion.

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.