edu.cmu.minorthird.classify.transform
Class InfoGainTransformLearner

java.lang.Object
  extended by edu.cmu.minorthird.classify.transform.InfoGainTransformLearner
All Implemented Interfaces:
InstanceTransformLearner

public class InfoGainTransformLearner
extends java.lang.Object
implements InstanceTransformLearner

A simple feature filter based on Ingormation Gain. The frequency model is resposible for deciding 'what to count'. If set to "document" this filter counts the number of documents which contain a Feature; if set to "word" this filter counts the number of times a Feature appears in the whole dataset.


Constructor Summary
InfoGainTransformLearner()
          Constructors
InfoGainTransformLearner(java.lang.String model)
           
 
Method Summary
 InstanceTransform batchTrain(Dataset dataset)
          Examine data, build an instance transformer
 double Entropy(double P1, double P2)
          compute the entropy of a binary attribute
 double getLength(Example e)
          Get the total number of words in an Example
static void main(java.lang.String[] args)
           
 void setSchema(ExampleSchema schema)
          Accept an ExampleSchema - constraints on what the Examples will be.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InfoGainTransformLearner

public InfoGainTransformLearner()
Constructors


InfoGainTransformLearner

public InfoGainTransformLearner(java.lang.String model)
Method Detail

setSchema

public void setSchema(ExampleSchema schema)
Accept an ExampleSchema - constraints on what the Examples will be.

Specified by:
setSchema in interface InstanceTransformLearner

batchTrain

public InstanceTransform batchTrain(Dataset dataset)
Examine data, build an instance transformer

Specified by:
batchTrain in interface InstanceTransformLearner

Entropy

public double Entropy(double P1,
                      double P2)
compute the entropy of a binary attribute


getLength

public double getLength(Example e)
Get the total number of words in an Example


main

public static void main(java.lang.String[] args)