netkit.classifiers.io
Class ReadEstimateRainbow

java.lang.Object
  extended by netkit.classifiers.io.ReadEstimateRainbow
All Implemented Interfaces:
ReadEstimate

public final class ReadEstimateRainbow
extends java.lang.Object
implements ReadEstimate

Reads in estimates of entities in a graph from a file where the format of each line is:

nodeID trueclass class:score ... class:score
Lines starting with '#' are ignored. This line format is equivalent to what you would see in the output from the Rainbow text classification package developed by Andrew McCallum.

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

Constructor Summary
ReadEstimateRainbow()
           
 
Method Summary
 void readEstimate(Graph graph, Estimate estimates, java.io.File input)
          Reads in a set of estimates from the given file, assuming that each line is of the form: nodeID trueclass class:score ...
 Estimate readEstimate(Graph graph, java.lang.String nodeType, AttributeCategorical attribute, java.io.File input)
          Create a new Estimate object and call the more general readEstimate method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadEstimateRainbow

public ReadEstimateRainbow()
Method Detail

readEstimate

public Estimate readEstimate(Graph graph,
                             java.lang.String nodeType,
                             AttributeCategorical attribute,
                             java.io.File input)
Create a new Estimate object and call the more general readEstimate method.

Specified by:
readEstimate in interface ReadEstimate
Parameters:
graph -
nodeType -
attribute -
input -
Returns:
A new Estimate object filled in with Estimates from the input file

readEstimate

public void readEstimate(Graph graph,
                         Estimate estimates,
                         java.io.File input)
Reads in a set of estimates from the given file, assuming that each line is of the form:
nodeID trueclass class:score ... class:score
where all classes in the underlying categorical attribute will be given a score.

ASSUMPTION: The underlying categorical attribute has already been initialized with the valid names for the attributes. Otherwise exceptions will be thrown!

Specified by:
readEstimate in interface ReadEstimate
Parameters:
graph -
estimates -
input -