netkit.classifiers.aggregators
Class Ratio
java.lang.Object
netkit.classifiers.aggregators.AggregatorImp
netkit.classifiers.aggregators.AggregatorByValueImp
netkit.classifiers.aggregators.Ratio
- All Implemented Interfaces:
- Aggregator, AggregatorByValue
public final class Ratio
- extends AggregatorByValueImp
The Ratio aggregator counts the ratio of times a specific value of a given
attribute is observed in the neighborhood of a node in the graph. Ratio is
defined as how often the value is observed divided by all the observed values.
In other words, if 'red' is observed in three neighbors and if colors other
than red are observed in seven neighbors, then the ratio of 'red' is 0.3.
Neighbors for which no value is observed are not counted.
- Author:
- Sofus A. Macskassy (sofmac@gmail.com)
Method Summary |
double |
getValue(Node n,
Estimate prior)
Gets the value stored in this object for the supplied Node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Ratio
public Ratio(EdgeType edgeType,
Attribute attribute,
double value)
getValue
public double getValue(Node n,
Estimate prior)
- Description copied from interface:
Aggregator
- Gets the value stored in this object for the supplied Node.
- Parameters:
n
- a Node for which to calculate and/or supply a value.prior
- current priors for unknown neighbor values.
- Returns:
- the value stored in this object for the supplied Node.