public static class SparseVector.NormalizingKernel extends Object implements SVMKernel, Serializable
Constructor and Description |
---|
SparseVector.NormalizingKernel(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.
|
Modifier and Type | Method and Description |
---|---|
double |
evaluate(Object o1,
Object o2)
Evaluate the kernel function between two SparseVectors.
|
SparseVector |
getNormalizingVector()
Retrive the current normalizing vector.
|
void |
setNormalizingVector(SparseVector nv)
Set the normalizing vector.
|
String |
toString() |
public SparseVector.NormalizingKernel(SparseVector s)
s
- the SparseVector to normalize bypublic SparseVector.NormalizingKernel(List vectors)
It will set up a normalizing vector that has weight that will scale each element so that the average score is 1.
public SparseVector getNormalizingVector()
public void setNormalizingVector(SparseVector nv)
nv
- the new normalizing vectorpublic double evaluate(Object o1, 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)
.
Copyright © 2014 BioJava. All rights reserved.