netkit.classifiers.aggregators
Class Ratio

java.lang.Object
  extended by netkit.classifiers.aggregators.AggregatorImp
      extended by netkit.classifiers.aggregators.AggregatorByValueImp
          extended by 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)

Field Summary
 
Fields inherited from class netkit.classifiers.aggregators.AggregatorByValueImp
attributeValue
 
Fields inherited from class netkit.classifiers.aggregators.AggregatorImp
aggregateCache, attribIdx, attribute, edgeType, name, type
 
Constructor Summary
Ratio(EdgeType edgeType, Attribute attribute, double value)
           
 
Method Summary
 double getValue(Node n, Estimate prior)
          Gets the value stored in this object for the supplied Node.
 
Methods inherited from class netkit.classifiers.aggregators.AggregatorByValueImp
getAttributeValue, toString
 
Methods inherited from class netkit.classifiers.aggregators.AggregatorImp
getAttribute, getAttributeIndex, getEdgeType, getName, getNodeInfo, getType, getValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface netkit.classifiers.aggregators.Aggregator
getAttribute, getEdgeType, getName, getType, getValue
 

Constructor Detail

Ratio

public Ratio(EdgeType edgeType,
             Attribute attribute,
             double value)
Method Detail

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.