public class RationalQuadraticKernel extends BaseL2Kernel
Constructor and Description |
---|
RationalQuadraticKernel(double c)
Creates a new RQ Kernel
|
Modifier and Type | Method and Description |
---|---|
RationalQuadraticKernel |
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 |
getC()
Returns the positive additive coefficient
|
static Distribution |
guessC(DataSet d)
Guess the distribution to use for the C parameter.
|
boolean |
normalized()
This method indicates if a kernel is a normalized kernel or not.
|
void |
setC(double c)
Sets the positive additive coefficient
|
addToCache, evalSum, evalSum, getAccelerationCache, getParameter, getParameters, getQueryInfo, getSqrdNorm, getSqrdNorm, getSqrdNorm, supportsAcceleration
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toString
public RationalQuadraticKernel(double c)
c
- the positive additive coefficientpublic void setC(double c)
c
- the positive additive coefficientpublic double getC()
public double eval(Vec a, Vec b)
KernelTrick
eval
in interface KernelTrick
eval
in class BaseL2Kernel
a
- the first vectorb
- the first vectorpublic 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 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 RationalQuadraticKernel clone()
clone
in interface KernelTrick
clone
in class BaseL2Kernel
public static Distribution guessC(DataSet d)
d
- the data set to get the guess forsetC(double)
public boolean normalized()
KernelTrick
true
if this is a normalized kernel. false
otherwise.Copyright © 2017. All rights reserved.