Struct linfa_svm::hyperparams::SvmValidParams
source · 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§
source§impl<F: Float, T> SvmValidParams<F, T>
impl<F: Float, T> SvmValidParams<F, T>
pub fn c(&self) -> Option<(F, F)>
pub fn nu(&self) -> Option<(F, F)>
pub fn solver_params(&self) -> &SolverParams<F>
pub fn kernel_params(&self) -> &KernelParams<F>
pub fn platt_params(&self) -> &PlattParams<F, ()>
Trait Implementations§
source§impl<F: Clone + Float, T: Clone> Clone for SvmValidParams<F, T>
impl<F: Clone + Float, T: Clone> Clone for SvmValidParams<F, T>
source§fn clone(&self) -> SvmValidParams<F, T>
fn clone(&self) -> SvmValidParams<F, T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more