netkit.classifiers.nonrelational
Class UniformPrior

java.lang.Object
  extended by netkit.classifiers.ClassifierImp
      extended by netkit.classifiers.nonrelational.UniformPrior
All Implemented Interfaces:
Classifier, Configurable

public final class UniformPrior
extends ClassifierImp

Dummy classifier that always predicts that all classes were equally likely. Useful for simple baseline experiments and to gain insight into other parts of NetKit such as the relational classifiers and inference methods.

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

Field Summary
 
Fields inherited from class netkit.classifiers.ClassifierImp
attribute, classPrior, clsIdx, graph, keyIndex, logger, nodeType, right, tmpVector, useIntrinsic, vectorClsIdx
 
Constructor Summary
UniformPrior()
           
 
Method Summary
 boolean estimate(Node node, double[] result)
          Fills the result array with all the same values---each class is equally likely.
 java.lang.String getDescription()
           
 java.lang.String getName()
           
 java.lang.String getShortName()
           
 void induceModel(Graph graph, DataSplit split)
          Makes a uniform prediction array---all classes are equally likely
 java.lang.String toString()
           
 
Methods inherited from class netkit.classifiers.ClassifierImp
addListener, classify, classify, clearListeners, configure, estimate, estimate, getAttributeNames, getDefaultConfiguration, getLogger, getNofifyListeners, makeVector, notifyListeners, notifyListeners, removeListener, reset, setNofityListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UniformPrior

public UniformPrior()
Method Detail

getShortName

public java.lang.String getShortName()
Returns:
'UniformPriorPredictor'

getName

public java.lang.String getName()
Returns:
'UniformPriorPredictor'

getDescription

public java.lang.String getDescription()
Returns:
'Always returns a uniform prior (all classes are equally likely).'

induceModel

public void induceModel(Graph graph,
                        DataSplit split)
Makes a uniform prediction array---all classes are equally likely

Specified by:
induceModel in interface Classifier
Overrides:
induceModel in class ClassifierImp
Parameters:
graph -
split -

estimate

public boolean estimate(Node node,
                        double[] result)
Fills the result array with all the same values---each class is equally likely.

Parameters:
node - The node to estimate class probabilities for
result - the double array containing the probability estimates that the node belongs to each of the possible class labels. These are set to 1/n, where n is the number of classes.
Returns:
true

toString

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