netkit.classifiers.nonrelational
Class ExternalPrior

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

public final class ExternalPrior
extends ClassifierImp

This classifier reads in estimates from a user-specified file. It uses a ReadEstimate object to read estimates from a file. It uses a Factory to get a ReadEstimate object. This factory is initialized from the readestimate.properties file.

The classifier itself has two properties (read from lclassifier.properties or specified from the commandline):

These are in addition to any properties used by the superclass.

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
ExternalPrior()
           
 
Method Summary
 void configure(Configuration config)
          Configure this classifier using the passed-in configuration.
 boolean estimate(Node node, double[] result)
          Estimate class probabilities for the given node--returns the read in estimates.
 Configuration getDefaultConfiguration()
          Sets a default configuration where the reader is of type 'rainbow', which should resolve to the ReadEstimateRainbow class in the 'readestimate.properties' file.
 java.lang.String getDescription()
           
 java.lang.String getName()
           
 java.lang.String getShortName()
           
 void induceModel(Graph graph, DataSplit split)
          Inducing this model simply means to read the estimates from the input file.
 java.lang.String toString()
           
 
Methods inherited from class netkit.classifiers.ClassifierImp
addListener, classify, classify, clearListeners, estimate, estimate, getAttributeNames, 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

ExternalPrior

public ExternalPrior()
Method Detail

getShortName

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

getName

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

getDescription

public java.lang.String getDescription()
Returns:
A short description

getDefaultConfiguration

public Configuration getDefaultConfiguration()
Sets a default configuration where the reader is of type 'rainbow', which should resolve to the ReadEstimateRainbow class in the 'readestimate.properties' file. This is in addition to any defaults set by the superclass.

Specified by:
getDefaultConfiguration in interface Configurable
Overrides:
getDefaultConfiguration in class ClassifierImp
Returns:
a default configuration object.
See Also:
ReadEstimateRainbow

configure

public void configure(Configuration config)
Configure this classifier using the passed-in configuration.

Specified by:
configure in interface Configurable
Overrides:
configure in class ClassifierImp
Parameters:
config - The configuration object to use to configure this classifier

induceModel

public void induceModel(Graph graph,
                        DataSplit split)
Inducing this model simply means to read the estimates from the input file.

Specified by:
induceModel in interface Classifier
Overrides:
induceModel in class ClassifierImp
Parameters:
graph - Graph whose nodes are to be estimated
split - The split between training and test. Used to get the nodetype and class attribute.

estimate

public boolean estimate(Node node,
                        double[] result)
Estimate class probabilities for the given node--returns the read in estimates.

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.
Returns:
true

toString

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