|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.biojava.stats.svm.SparseVector.NormalizingKernel
A version of the standard dot-product kernel that scales each column independantly.
Constructor Summary | |
SparseVector.NormalizingKernel(java.util.List vectors)
Generate a normalizing kernel defined by the SparseVectors in vectors. |
|
SparseVector.NormalizingKernel(SparseVector s)
Generate a normalizing kernel with the normalizing vector s. |
Method Summary | |
double |
evaluate(java.lang.Object o1,
java.lang.Object o2)
Evaluate the kernel function between two SparseVectors. |
SparseVector |
getNormalizingVector()
Retrive the current normalizing vector. |
void |
setNormalizingVector(SparseVector nv)
Set the normalizing vector. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public SparseVector.NormalizingKernel(SparseVector s)
s
- the SparseVector to normalize bypublic SparseVector.NormalizingKernel(java.util.List vectors)
It will set up a normalizing vector that has weight that will scale each element so that the average score is 1.
Method Detail |
public SparseVector getNormalizingVector()
public void setNormalizingVector(SparseVector nv)
the
- new normalizing vectorpublic double evaluate(java.lang.Object o1, java.lang.Object o2)
This function is equivalent to:
k(a, b) = sum_i ( a_i * b_i * nv_i )
where nv_i is the value of the normalizing vector at index i. This can
be thought of as scaling each vector at index i by
sqrt(nv_i)
.
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |