netkit.classifiers.aggregators
Class Mode

java.lang.Object
  extended by netkit.classifiers.aggregators.AggregatorImp
      extended by netkit.classifiers.aggregators.Mode
All Implemented Interfaces:
Aggregator

public final class Mode
extends AggregatorImp

The Mode aggregator counts the number of times each possible value of a given attribute is observed in the neighborhood of a node in the graph and returns the value that is observed the most. If there is a tie then the value is returned through a stochastic process.

Author:
Sofus A. Macskassy (sofmac@gmail.com)

Field Summary
 
Fields inherited from class netkit.classifiers.aggregators.AggregatorImp
aggregateCache, attribIdx, attribute, edgeType, name, type
 
Constructor Summary
Mode(EdgeType edgeType, Attribute attribute)
           
 
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.AggregatorImp
getAttribute, getAttributeIndex, getEdgeType, getName, getNodeInfo, getType, getValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Mode

public Mode(EdgeType edgeType,
            Attribute attribute)
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.