jsat.distributions.kernels
Class PukKernel
- java.lang.Object
-
- jsat.distributions.kernels.BaseL2Kernel
-
- jsat.distributions.kernels.PukKernel
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, KernelTrick, Parameterized
public class PukKernel extends BaseL2Kernel implements Parameterized
The PUK kernel is an alternative to the RBF Kernel. By altering theomegaparameter the behavior of the PUK kernel can be controlled. Thesigmaparameter works in the same way as the RBF Kernel.
See: Üstün, B., Melssen, W. J.,&Buydens, L. M. C. (2006). Facilitating the application of Support Vector Regression by using a universal Pearson VII function based kernel. Chemometrics and Intelligent Laboratory Systems, 81(1), 29–40. doi:10.1016/j.chemolab.2005.09.003- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description PukKernel(double sigma, double omega)Creates a new PUK Kernel
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description PukKernelclone()doubleeval(int a, int b, java.util.List<? extends Vec> trainingSet, java.util.List<java.lang.Double> cache)Produces the correct kernel evaluation given the training set and the cache generated byKernelTrick.getAccelerationCache(List).doubleeval(int a, Vec b, java.util.List<java.lang.Double> qi, java.util.List<? extends Vec> vecs, java.util.List<java.lang.Double> cache)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 byKernelTrick.getQueryInfo(jsat.linear.Vec).doubleeval(Vec a, Vec b)Evaluate this kernel function for the two given vectors.doublegetOmega()doublegetSigma()static DistributionguessOmega(DataSet d)Guesses the distribution to use for the ω parameterstatic DistributionguessSigma(DataSet d)Guesses the distribution to use for the λ parameterbooleannormalized()This method indicates if a kernel is a normalized kernel or not.voidsetOmega(double omega)Sets the omega parameter value, which controls the shape of the kernelvoidsetSigma(double sigma)Sets the sigma parameter value, which controls the width of the kernel-
Methods inherited from class jsat.distributions.kernels.BaseL2Kernel
addToCache, evalSum, evalSum, getAccelerationCache, getQueryInfo, supportsAcceleration
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsat.parameters.Parameterized
getParameter, getParameters
-
Methods inherited from interface jsat.distributions.kernels.KernelTrick
toString
-
-
-
-
Constructor Detail
-
PukKernel
public PukKernel(double sigma, double omega)Creates a new PUK Kernel- Parameters:
sigma- the width parameter of the kernelomega- the shape parameter of the kernel
-
-
Method Detail
-
setOmega
public void setOmega(double omega)
Sets the omega parameter value, which controls the shape of the kernel- Parameters:
omega- the positive parameter value
-
getOmega
public double getOmega()
-
setSigma
public void setSigma(double sigma)
Sets the sigma parameter value, which controls the width of the kernel- Parameters:
sigma- the positive parameter value
-
getSigma
public double getSigma()
-
eval
public double eval(Vec a, Vec b)
Description copied from interface:KernelTrickEvaluate this kernel function for the two given vectors.- Specified by:
evalin interfaceKernelTrick- Specified by:
evalin classBaseL2Kernel- Parameters:
a- the first vectorb- the first vector- Returns:
- the evaluation
-
clone
public PukKernel clone()
- Specified by:
clonein interfaceKernelTrick- Specified by:
clonein classBaseL2Kernel
-
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:KernelTrickComputes 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 byKernelTrick.getQueryInfo(jsat.linear.Vec).
If the cache input isnull, thenKernelTrick.eval(jsat.linear.Vec, jsat.linear.Vec)will be called directly.- Specified by:
evalin interfaceKernelTrick- Specified by:
evalin classBaseL2Kernel- Parameters:
a- the index of the vector in the cacheb- the other vectorqi- the query information about bvecs- the list of vectors used to build the cachecache- the cache associated with the given list of vectors- Returns:
- the kernel product of the two vectors
-
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:KernelTrickProduces the correct kernel evaluation given the training set and the cache generated byKernelTrick.getAccelerationCache(List). The training vectors should be in the same order.- Specified by:
evalin interfaceKernelTrick- Specified by:
evalin classBaseL2Kernel- Parameters:
a- the index of the first training vectorb- the index of the second training vectortrainingSet- the list of training set vectorscache- 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)
-
guessOmega
public static Distribution guessOmega(DataSet d)
Guesses the distribution to use for the ω parameter- Parameters:
d- the dataset to get the guess for- Returns:
- the guess for the ω parameter
- See Also:
setOmega(double)
-
guessSigma
public static Distribution guessSigma(DataSet d)
Guesses the distribution to use for the λ parameter- Parameters:
d- the dataset to get the guess for- Returns:
- the guess for the λ parameter
- See Also:
setSigma(double)
-
normalized
public boolean normalized()
Description copied from interface:KernelTrickThis 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.- Specified by:
normalizedin interfaceKernelTrick- Returns:
trueif this is a normalized kernel.falseotherwise.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG