public class WeightedPolynomialMixingKernel extends java.lang.Object implements Kernel
(\sum w_i * k(x_i, y_i) \div \sum w_i ) ^ l
pow
the power to raise things to
attributeKey
the children of this node form a 'vector'. This is the
attribute that we use to 'index' this vector
mapIndexWeight
the indices (i.e. the value of
child.getValue().get(attributeKey)
and the corresponding
weights. The indices must be integers. The
class must be identical to the class of the child - take care that the
numeric types match.
delegateKernel
the kernel to apply to pairs of children.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
attributeKey |
private Kernel |
delegateKernel |
private java.util.Map<java.lang.Integer,java.lang.Double> |
mapIndexWeight |
private int |
pow |
private double |
scalingFactor |
Constructor and Description |
---|
WeightedPolynomialMixingKernel() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
precompute the scaling factor - we will always divide by this
|
double |
evaluate(java.lang.Object o1,
java.lang.Object o2) |
java.lang.String |
getAttributeKey() |
Kernel |
getDelegateKernel() |
java.util.Map<java.lang.Integer,java.lang.Double> |
getMapIndexWeight() |
private Node |
getNodeForIndex(int index,
Node o1) |
int |
getPow() |
void |
setAttributeKey(java.lang.String attributeKey) |
void |
setDelegateKernel(Kernel delegateKernel) |
void |
setMapIndexWeight(java.util.Map<java.lang.Integer,java.lang.Double> mapIndexWeight) |
void |
setPow(int pow) |
private int pow
private java.lang.String attributeKey
private java.util.Map<java.lang.Integer,java.lang.Double> mapIndexWeight
private Kernel delegateKernel
private double scalingFactor
public int getPow()
public void setPow(int pow)
public java.lang.String getAttributeKey()
public void setAttributeKey(java.lang.String attributeKey)
public java.util.Map<java.lang.Integer,java.lang.Double> getMapIndexWeight()
public void setMapIndexWeight(java.util.Map<java.lang.Integer,java.lang.Double> mapIndexWeight)
public Kernel getDelegateKernel()
public void setDelegateKernel(Kernel delegateKernel)
public double evaluate(java.lang.Object o1, java.lang.Object o2)
private Node getNodeForIndex(int index, Node o1)
index
- the attribute has to match thiso1
- the node whose children we're going to searchpublic void afterPropertiesSet() throws java.lang.Exception
java.lang.Exception