Documentation of 'jsat.distributions.kernels.RationalQuadraticKernel' Java class
RationalQuadraticKernel
jsat.distributions.kernels

Class RationalQuadraticKernel

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, KernelTrick, Parameterized


    public class RationalQuadraticKernel
    extends BaseL2Kernel
    Provides an implementation of the Rational Quadratic Kernel, which is of the form:
    k(x, y) = 1 - ||x-y||2 / (||x-y||2 + c)
    See Also:
    Serialized Form
    • Constructor Detail

      • RationalQuadraticKernel

        public RationalQuadraticKernel(double c)
        Creates a new RQ Kernel
        Parameters:
        c - the positive additive coefficient
    • Method Detail

      • setC

        public void setC(double c)
        Sets the positive additive coefficient
        Parameters:
        c - the positive additive coefficient
      • getC

        public double getC()
        Returns the positive additive coefficient
        Returns:
        the positive additive coefficient
      • eval

        public double eval(Vec a,
                           Vec b)
        Description copied from interface: KernelTrick
        Evaluate this kernel function for the two given vectors.
        Specified by:
        eval in interface KernelTrick
        Specified by:
        eval in class BaseL2Kernel
        Parameters:
        a - the first vector
        b - the first vector
        Returns:
        the evaluation
      • eval

        public double eval(int a,
                           int b,
                           java.util.List<? extends Vec> trainingSet,
                           java.util.List<java.lang.Double> cache)
        Description copied from interface: KernelTrick
        Produces the correct kernel evaluation given the training set and the cache generated by KernelTrick.getAccelerationCache(List). The training vectors should be in the same order.
        Specified by:
        eval in interface KernelTrick
        Specified by:
        eval in class BaseL2Kernel
        Parameters:
        a - the index of the first training vector
        b - the index of the second training vector
        trainingSet - the list of training set vectors
        cache - the double list of cache values generated by this kernel for the given training set
        Returns:
        the same kernel evaluation result as KernelTrick.eval(jsat.linear.Vec, jsat.linear.Vec)
      • eval

        public double eval(int a,
                           Vec b,
                           java.util.List<java.lang.Double> qi,
                           java.util.List<? extends Vec> vecs,
                           java.util.List<java.lang.Double> cache)
        Description copied from interface: KernelTrick
        Computes the kernel product between one vector in the original list of vectors with that of another vector not from the original list, but had information generated by KernelTrick.getQueryInfo(jsat.linear.Vec).
        If the cache input is null, then KernelTrick.eval(jsat.linear.Vec, jsat.linear.Vec) will be called directly.
        Specified by:
        eval in interface KernelTrick
        Specified by:
        eval in class BaseL2Kernel
        Parameters:
        a - the index of the vector in the cache
        b - the other vector
        qi - the query information about b
        vecs - the list of vectors used to build the cache
        cache - the cache associated with the given list of vectors
        Returns:
        the kernel product of the two vectors
      • guessC

        public static Distribution guessC(DataSet d)
        Guess the distribution to use for the C parameter.
        Parameters:
        d - the data set to get the guess for
        Returns:
        the guess for the C parameter
        See Also:
        setC(double)
      • normalized

        public boolean normalized()
        Description copied from interface: KernelTrick
        This method indicates if a kernel is a normalized kernel or not. A normalized kernel is one in which k(x,x) = 1 for the same object, and no value greater than 1 can be returned.
        Returns:
        true if this is a normalized kernel. false otherwise.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.