netkit.classifiers.relational
Class Harmonic
java.lang.Object
netkit.classifiers.ClassifierImp
netkit.classifiers.relational.NetworkClassifierImp
netkit.classifiers.relational.Harmonic
- All Implemented Interfaces:
- Classifier, NetworkClassifier, Configurable
public class Harmonic
- extends NetworkClassifierImp
The Harmonic Function classifier from Zhu (2003)
Reference:
- Zhu, X., Ghahramani, Z., & Lafferty, J. (2003).
Semi-supervised learning using Gaussian fields and harmonic functions.
The 20th International Conference on Machine Learning (ICML).
This takes no parameters and does not use collective inference. It uses only
known labels and the graph.
- Author:
- Sofus A. Macskassy
Fields inherited from class netkit.classifiers.ClassifierImp |
attribute, classPrior, clsIdx, graph, keyIndex, logger, nodeType, right, tmpVector, useIntrinsic, vectorClsIdx |
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 |
Harmonic
public Harmonic()
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 graphunknowns
- 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 oversplit
- 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