public class PukKernel extends BaseL2Kernel implements Parameterized
omega
parameter the behavior of the PUK kernel can
be controlled. The sigma
parameter works in the
same way as the RBF Kernel.Constructor and Description |
---|
PukKernel(double sigma,
double omega)
Creates a new PUK Kernel
|
Modifier and Type | Method and Description |
---|---|
PukKernel |
clone() |
double |
eval(int a,
int b,
List<? extends Vec> trainingSet,
List<Double> cache)
Produces the correct kernel evaluation given the training set and the
cache generated by
KernelTrick.getAccelerationCache(List) . |
double |
eval(int a,
Vec b,
List<Double> qi,
List<? extends Vec> vecs,
List<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 by
KernelTrick.getQueryInfo(jsat.linear.Vec) . |
double |
eval(Vec a,
Vec b)
Evaluate this kernel function for the two given vectors.
|
double |
getOmega() |
double |
getSigma() |
static Distribution |
guessOmega(DataSet d)
Guesses the distribution to use for the ω parameter
|
static Distribution |
guessSigma(DataSet d)
Guesses the distribution to use for the λ parameter
|
boolean |
normalized()
This method indicates if a kernel is a normalized kernel or not.
|
void |
setOmega(double omega)
Sets the omega parameter value, which controls the shape of the kernel
|
void |
setSigma(double sigma)
Sets the sigma parameter value, which controls the width of the kernel
|
addToCache, evalSum, evalSum, getAccelerationCache, getParameter, getParameters, getQueryInfo, getSqrdNorm, getSqrdNorm, getSqrdNorm, supportsAcceleration
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParameter, getParameters
toString
public PukKernel(double sigma, double omega)
sigma
- the width parameter of the kernelomega
- the shape parameter of the kernelpublic void setOmega(double omega)
omega
- the positive parameter valuepublic double getOmega()
public void setSigma(double sigma)
sigma
- the positive parameter valuepublic double getSigma()
public double eval(Vec a, Vec b)
KernelTrick
eval
in interface KernelTrick
eval
in class BaseL2Kernel
a
- the first vectorb
- the first vectorpublic PukKernel clone()
clone
in interface KernelTrick
clone
in class BaseL2Kernel
public double eval(int a, Vec b, List<Double> qi, List<? extends Vec> vecs, List<Double> cache)
KernelTrick
KernelTrick.getQueryInfo(jsat.linear.Vec)
.
null
, then
KernelTrick.eval(jsat.linear.Vec, jsat.linear.Vec)
will be called directly.eval
in interface KernelTrick
eval
in class BaseL2Kernel
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 vectorspublic double eval(int a, int b, List<? extends Vec> trainingSet, List<Double> cache)
KernelTrick
KernelTrick.getAccelerationCache(List)
. The training
vectors should be in the same order.eval
in interface KernelTrick
eval
in class BaseL2Kernel
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 setKernelTrick.eval(jsat.linear.Vec, jsat.linear.Vec)
public static Distribution guessOmega(DataSet d)
d
- the dataset to get the guess forsetOmega(double)
public static Distribution guessSigma(DataSet d)
d
- the dataset to get the guess forsetSigma(double)
public boolean normalized()
KernelTrick
normalized
in interface KernelTrick
true
if this is a normalized kernel. false
otherwise.Copyright © 2017. All rights reserved.