Package smile.anomaly

Class SVM<T>

All Implemented Interfaces:
Serializable

public class SVM<T> extends KernelMachine<T>
One-class support vector machines for novelty detection. One-class SVM relies on identifying the smallest hypersphere consisting of all the data points. Therefore, it is sensitive to outliers. If the training data is not contaminated by outliers, the model is best suited for novelty detection.

References

  1. B. Schölkopf, J. Platt, J. Shawe-Taylor, A. J. Smola, and R. C. Williamson. Estimating the support of a high-dimensional distribution. Neural Computation, 2001.
  2. Jia Jiong and Zhang Hao-ran. A Fast Learning Algorithm for One-Class Support Vector Machine. ICNC 2007.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    SVM(smile.math.kernel.MercerKernel<T> kernel, T[] vectors, double[] weight, double b)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> SVM<T>
    fit(T[] x, smile.math.kernel.MercerKernel<T> kernel)
    Fits an one-class SVM.
    static <T> SVM<T>
    fit(T[] x, smile.math.kernel.MercerKernel<T> kernel, double nu, double tol)
    Fits an one-class SVM.

    Methods inherited from class smile.base.svm.KernelMachine

    intercept, kernel, score, toString, vectors, weights

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SVM

      public SVM(smile.math.kernel.MercerKernel<T> kernel, T[] vectors, double[] weight, double b)
      Constructor.
      Parameters:
      kernel - Kernel function.
      vectors - The support vectors.
      weight - The weights of instances.
      b - The intercept;
  • Method Details

    • fit

      public static <T> SVM<T> fit(T[] x, smile.math.kernel.MercerKernel<T> kernel)
      Fits an one-class SVM.
      Type Parameters:
      T - the data type.
      Parameters:
      x - training samples.
      kernel - the kernel function.
      Returns:
      the model.
    • fit

      public static <T> SVM<T> fit(T[] x, smile.math.kernel.MercerKernel<T> kernel, double nu, double tol)
      Fits an one-class SVM.
      Type Parameters:
      T - the data type.
      Parameters:
      x - training samples.
      kernel - the kernel function.
      nu - the parameter sets an upper bound on the fraction of outliers (training examples regarded out-of-class) and it is a lower bound on the number of training examples used as Support Vector.
      tol - the tolerance of convergence test.
      Returns:
      the model.