Skip to main content

fit

Function fit 

Source
pub fn fit(
    x: &[f64],
    y: &[bool],
    n: usize,
    p: usize,
    c: f64,
    kernel: Kernel,
    max_passes: usize,
    tol: f64,
) -> Result<Svm, LearningError>
Expand description

Fit a soft-margin SVM by simplified SMO. c is the regularization (box) bound, max_passes the number of consecutive no-change sweeps to declare convergence. Fails closed on shape mismatch / a single-class target.