Class KernelMachine<T>

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

public class KernelMachine<T> extends KernelMachine<T> implements Regression<T>
The learning methods building on kernels. Kernel methods owe their name to the use of kernel functions, which enable them to operate in a high-dimensional, implicit feature space without ever computing the coordinates of the data in that space, but rather by simply computing the inner products between the images of all pairs of data in the feature space.

Kernel methods can be thought of as instance-based learners: rather than learning some fixed set of parameters corresponding to the features of their inputs, they instead store (a subset of) their training set (or a new representation) and learn for it a corresponding weight. Prediction for unlabeled inputs is treated by the application of a similarity function.

See Also:
  • Constructor Details

    • KernelMachine

      public KernelMachine(MercerKernel<T> kernel, T[] instances, double[] weight)
      Constructor.
      Parameters:
      kernel - Kernel function.
      instances - The instances in the kernel machine, e.g. support vectors.
      weight - The weights of instances.
    • KernelMachine

      public KernelMachine(MercerKernel<T> kernel, T[] instances, double[] weight, double b)
      Constructor.
      Parameters:
      kernel - Kernel function.
      instances - The instances in the kernel machine, e.g. support vectors.
      weight - The weights of instances.
      b - The intercept;
  • Method Details

    • predict

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