E
- the class of the data instances to be compared by this kernelpublic abstract class Kernel<E>
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Kernel(boolean norm,
boolean cacheNorm,
boolean mapCache)
Creates a kernel object the returned kernel value for the computation
can be normalised and can or not use of caches
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
double |
compute(DataObject<E> x1,
DataObject<E> x2)
Computes the kernel value for two data instances
|
Kernel<E> |
computeKernelMatrix(java.util.List<DataObject<E>> samples)
Creates a matrix to be used for caching purposes.
|
Kernel<E> |
computeKernelMatrix(java.util.List<DataObject<E>> samples,
java.util.Map<java.lang.Integer,java.lang.Integer> conversorId)
Creates a matrix to be used for caching purposes.
|
abstract DataObject<E> |
convertVector(DataObject<E> x)
Transforms a DataObject into another DataObject with modifications
to be in the right format for this kernel
|
boolean |
getBNorm()
Get the bNorm variable which tells if the kernel is normalised
|
void |
setUseCache(boolean useCache) |
public Kernel(boolean norm, boolean cacheNorm, boolean mapCache)
norm
- a boolean that tells the kernel to return the normalised valuescacheNorm
- a boolean that controls the use of a cache for values
returned by computing the kernel for two equal data instancesmapCache
- a boolean that allows the use of a cache based on Maps for
kernel valuespublic void setUseCache(boolean useCache)
public double compute(DataObject<E> x1, DataObject<E> x2)
x1
- a data instancex2
- a data instancepublic abstract DataObject<E> convertVector(DataObject<E> x) throws InvalidVectorIndexException
x
- a DataObject that encapsulates the data instance to be
transformedInvalidVectorIndexException
- when the DataObject to be transformed
has occupied reserved constantspublic void clear()
public Kernel<E> computeKernelMatrix(java.util.List<DataObject<E>> samples, java.util.Map<java.lang.Integer,java.lang.Integer> conversorId)
samples
- the data instancesconversorId
- the conversorpublic Kernel<E> computeKernelMatrix(java.util.List<DataObject<E>> samples)
samples
- the data instancespublic boolean getBNorm()