|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.stats.svm.SparseVector.NormalizingKernel
public static class SparseVector.NormalizingKernel
A version of the standard dot-product kernel that scales each column independently.
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)
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)
.
evaluate
in interface SVMKernel
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |