netkit.classifiers.relational
Class Harmonic

java.lang.Object
  extended by netkit.classifiers.ClassifierImp
      extended by netkit.classifiers.relational.NetworkClassifierImp
          extended by netkit.classifiers.relational.Harmonic
All Implemented Interfaces:
Classifier, NetworkClassifier, Configurable

public class Harmonic
extends NetworkClassifierImp

The Harmonic Function classifier from Zhu (2003) Reference:

This takes no parameters and does not use collective inference. It uses only known labels and the graph.

Author:
Sofus A. Macskassy

Nested Class Summary
 
Nested classes/interfaces inherited from class netkit.classifiers.relational.NetworkClassifierImp
NetworkClassifierImp.Aggregation
 
Field Summary
 
Fields inherited from class netkit.classifiers.relational.NetworkClassifierImp
aggFactory, aggregation, aggregators, aggTypes, dynamicAggregators, prior
 
Fields inherited from class netkit.classifiers.ClassifierImp
attribute, classPrior, clsIdx, graph, keyIndex, logger, nodeType, right, tmpVector, useIntrinsic, vectorClsIdx
 
Constructor Summary
Harmonic()
           
 
Method Summary
 boolean doEstimate(Node node, double[] estimation)
          Returns the prediction computer in the induceModel call.
 java.lang.String getDescription()
           
 double getERM(Node n)
           
 double[] getERM(Node n, Classification truth)
           
 java.lang.String getName()
           
 java.lang.String getShortName()
           
 void induceModel(Graph graph, DataSplit split)
          Harmonic has no model per se as its learning consists of computing the harmonic function which results in the predictions.
 void initializeRun(Estimate currPrior, Node[] unknowns)
          This initializes Harmonic function for the next collective inference iteration by doing absolutely nothing.
 java.lang.String toString()
           
 
Methods inherited from class netkit.classifiers.relational.NetworkClassifierImp
classify, configure, estimate, estimate, estimate, estimate, generateAggregators, getAttributeNames, getDefaultConfiguration, includeClassAttribute, makeVector
 
Methods inherited from class netkit.classifiers.ClassifierImp
addListener, classify, classify, clearListeners, estimate, estimate, getLogger, getNofifyListeners, notifyListeners, notifyListeners, removeListener, reset, setNofityListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface netkit.classifiers.Classifier
addListener, classify, classify, clearListeners, estimate, estimate, getLogger, getNofifyListeners, notifyListeners, notifyListeners, removeListener, reset, setNofityListeners
 

Constructor Detail

Harmonic

public Harmonic()
Method Detail

getShortName

public java.lang.String getShortName()

getName

public java.lang.String getName()

getDescription

public java.lang.String getDescription()

initializeRun

public void initializeRun(Estimate currPrior,
                          Node[] unknowns)
This initializes Harmonic function for the next collective inference iteration by doing absolutely nothing.

Specified by:
initializeRun in interface NetworkClassifier
Overrides:
initializeRun in class NetworkClassifierImp
Parameters:
currPrior - The current priors for all nodes in the graph
unknowns - The list of nodes whose labels are unknown

doEstimate

public boolean doEstimate(Node node,
                          double[] estimation)
Returns the prediction computer in the induceModel call.

Specified by:
doEstimate in class NetworkClassifierImp
Parameters:
node -
estimation -
Returns:
true, if the node was part of the original test set, false otherwise.

getERM

public double getERM(Node n)

getERM

public double[] getERM(Node n,
                       Classification truth)

induceModel

public void induceModel(Graph graph,
                        DataSplit split)
Harmonic has no model per se as its learning consists of computing the harmonic function which results in the predictions. Thus, this call creates the predictions for all the instances in the split test set.

Specified by:
induceModel in interface Classifier
Overrides:
induceModel in class NetworkClassifierImp
Parameters:
graph - The graph to induce a model over
split - The data split identifying which nodes have known and unknown labels
See Also:
NetworkClassifierImp.induceModel(netkit.graph.Graph, netkit.classifiers.DataSplit)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object