public class NormalizingKernel extends NestedKernel
This is equivalent to making the locations in feature space of the nested
kernel unit vectors lying on a unit sphere. The dot product in feature space
then becomes just cos theta
rather than
||a|| * ||b|| * cos theta
as both lengths are 1. The length of
a in the feature space of kernel k is sqrt( k(a, a) )
, so that
the normalizing kernel ends up calculating
k(a, b) / sqrt( k(a, a) * k(b, b) )
.
As the values of k(x, x) are required repeatedly, it may be worth making the nested kernel a DiagonalCachingKernel.
Constructor and Description |
---|
NormalizingKernel() |
NormalizingKernel(SVMKernel k) |
Modifier and Type | Method and Description |
---|---|
double |
evaluate(Object a,
Object b)
Return the dot product of two vectors in an arbitrary
feature space.
|
String |
toString() |
getNestedKernel, setNestedKernel
public NormalizingKernel()
public NormalizingKernel(SVMKernel k)
Copyright © 2014 BioJava. All rights reserved.