Class SparseLinearSVM

java.lang.Object
smile.regression.SparseLinearSVM
All Implemented Interfaces:
Serializable, ToDoubleFunction<SparseArray>, Regression<SparseArray>

public class SparseLinearSVM extends Object implements Regression<SparseArray>
Sparse linear support vector machines for regression.
See Also:
  • Constructor Details

    • SparseLinearSVM

      public SparseLinearSVM(int p, KernelMachine<SparseArray> svm)
      Constructor.
      Parameters:
      p - the dimension of input vector.
      svm - The kernel machine.
  • Method Details

    • weights

      public double[] weights()
      Returns the linear weights.
      Returns:
      the linear weights.
    • intercept

      public double intercept()
      Returns the intercept.
      Returns:
      the intercept.
    • predict

      public double predict(SparseArray x)
      Description copied from interface: Regression
      Predicts the dependent variable of an instance.
      Specified by:
      predict in interface Regression<SparseArray>
      Parameters:
      x - an instance.
      Returns:
      the predicted value of dependent variable.