public class CachingKernel extends NestedKernel
Caches the results of a nested kernel so that k(a, b) need only be calculated once.
This kernel is thread-safe. However, care must be taken when setting the nested kernel that no other thread is retrieving values at the same time. This would cause a race condition in which the newly flushed cache may contain a value from the previous kernel.
Constructor and Description |
---|
CachingKernel() |
CachingKernel(SVMKernel k) |
Modifier and Type | Method and Description |
---|---|
double |
evaluate(Object x,
Object y)
Return the dot product of two vectors in an arbitrary
feature space.
|
void |
setNestedKernel(SVMKernel k)
Set the SVMKernel to nest to
k.
|
String |
toString() |
getNestedKernel
public CachingKernel()
public CachingKernel(SVMKernel k)
public void setNestedKernel(SVMKernel k)
NestedKernel
setNestedKernel
in class NestedKernel
k
- the SVMKernel to nest.public double evaluate(Object x, Object y)
SVMKernel
Copyright © 2014 BioJava. All rights reserved.