Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Support vector machines

solow-svm ships linear and kernel SVMs for classification and regression, ν-SVM variants, and one-class SVM for novelty detection.

Linear SVMs (Pegasos-style)

EstimatorWhat it does
LinearSvcBinary and one-vs-rest multiclass linear SVC (Shalev-Shwartz-Singer-Srebro 2007) with deterministic MMIX-LCG shuffle.
LinearSvrε-insensitive Vapnik linear regressor with the same stochastic solver.

Kernel SVMs (SMO)

EstimatorWhat it does
SvcKernel SVC with linear, RBF, polynomial, sigmoid kernels via sequential minimal optimization. Platt scaling for calibrated probabilities.
SvrKernel ε-SVR for regression.
NuSvcν-SVM variant parametrizing the fraction of support vectors directly.
NuSvrν-SVR regression variant.

Novelty detection

EstimatorWhat it does
OneClassSvmBoundary estimation in feature space for one-class classification and novelty detection.

Example

#![allow(unused)]
fn main() {
use solow_svm::{Svc, KernelKind};

let svc = Svc::builder()
    .kernel(KernelKind::Rbf { gamma: 0.5 })
    .c(1.0)
    .seed(42)
    .fit(&x, &y)?;

let pred = svc.predict(&x_test)?;
let proba = svc.predict_proba(&x_test)?;
Ok::<_, solow_core::Error>(())
}

References

  • Shalev-Shwartz, S., Singer, Y., Srebro, N., & Cotter, A. (2007). Pegasos: Primal estimated sub-gradient solver for SVM. ICML.
  • Platt, J. C. (1998). Sequential minimal optimization: A fast algorithm for training support vector machines. Microsoft Research MSR-TR-98-14.