Class LASVM<T>

java.lang.Object
smile.base.svm.LASVM<T>
Type Parameters:
T - the data type of model input objects.
All Implemented Interfaces:
Serializable

public class LASVM<T> extends Object implements Serializable
LASVM is an approximate SVM solver that uses online approximation. It reaches accuracies similar to that of a real SVM after performing a single sequential pass through the training examples. Further benefits can be achieved using selective sampling techniques to choose which example should be considered next. LASVM requires considerably less memory than a regular SVM solver. This becomes a considerable speed advantage for large training sets.
See Also:
  • Constructor Details

    • LASVM

      public LASVM(MercerKernel<T> kernel, double C, double tol)
      Constructor.
      Parameters:
      kernel - the kernel.
      C - the soft margin penalty parameter.
      tol - the tolerance of convergence test.
    • LASVM

      public LASVM(MercerKernel<T> kernel, double Cp, double Cn, double tol)
      Constructor.
      Parameters:
      kernel - the kernel.
      Cp - the soft margin penalty parameter for positive instances.
      Cn - the soft margin penalty parameter for negative instances.
      tol - the tolerance of convergence test.
  • Method Details

    • fit

      public KernelMachine<T> fit(T[] x, int[] y, int epochs)
      Trains the model.
      Parameters:
      x - training samples.
      y - training labels.
      epochs - the number of epochs, usually 1 or 2 is sufficient.
      Returns:
      the model.