Class LinearSVM

java.lang.Object
smile.regression.LinearSVM
All Implemented Interfaces:
Serializable, ToDoubleFunction<double[]>, Regression<double[]>

public class LinearSVM extends Object implements Regression<double[]>
Linear support vector machines for regression.
See Also:
  • Constructor Details

    • LinearSVM

      public LinearSVM(KernelMachine<double[]> svm)
      Constructor.
      Parameters:
      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(double[] x)
      Description copied from interface: Regression
      Predicts the dependent variable of an instance.
      Specified by:
      predict in interface Regression<double[]>
      Parameters:
      x - an instance.
      Returns:
      the predicted value of dependent variable.