Class LinearKernel

java.lang.Object
com.imsl.datamining.supportvectormachine.Kernel
com.imsl.datamining.supportvectormachine.LinearKernel
All Implemented Interfaces:
Cloneable

public class LinearKernel extends Kernel
Specifies the linear kernel for support vector machines.

The kernel function at two data nodes, \(x_i\) and \(x_j\), is given by \(K(x_i , x_j) = x_i^Tx_j\).

  • Constructor Details

    • LinearKernel

      public LinearKernel()
      Constructs a LinearKernel with default parameters.
    • LinearKernel

      public LinearKernel(LinearKernel linKernel)
      Constructs a copy of the input LinearKernel kernel.
      Parameters:
      linKernel - a LinearKernel kernel
  • Method Details

    • clone

      public LinearKernel clone()
      Clones a LinearKernel kernel.
      Specified by:
      clone in class Kernel
      Returns:
      a clone of the LinearKernel kernel
    • kernelFunction

      public double kernelFunction(DataNode[] x, DataNode[] y)
      Calculates the kernel function between two DataNodes.
      Specified by:
      kernelFunction in class Kernel
      Parameters:
      x - a DataNode array
      y - a DataNode array
      Returns:
      a double, the kernel function evaluated at x and y
    • kernelFunction

      public double kernelFunction(DataNode[][] x, int i, int j)
      Calculates the kernel function between two DataNodes.
      Specified by:
      kernelFunction in class Kernel
      Parameters:
      x - a DataNode matrix
      i - an int, index to the first DataNode, x[i]
      j - an int, index to the second DataNode, x[j]
      Returns:
      a double, the kernel function evaluated at x[i] and x[j]