edu.cmu.minorthird.classify.transform
Class T1InstanceTransformLearner

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

public class T1InstanceTransformLearner
extends java.lang.Object
implements InstanceTransformLearner

Author:
Edoardo Airoldi Date: Nov 24, 2003

Constructor Summary
T1InstanceTransformLearner()
           
 
Method Summary
 InstanceTransform batchTrain(Dataset dataset)
          Examine data, build an instance transformer
 double getLength(Example e)
          Get the total number of words in an Example
static void main(java.lang.String[] args)
           
 double MaximumLikelihoodPoisson(double[] x, double[] omega, double prior)
          Compute the maximum likelihood estimate of the rate 'mu' of a Poisson model, using integer counts x[] from examples with different lengths omega[].
 java.util.SortedMap<java.lang.String,java.lang.Double> MethodOfMomentsNegBin(double[] x, double[] omega, double prior)
          Compute the method of moment estimates of the rate 'mu' and the parameter which controls the variability 'delta' of a Negative-Binomial models, using integer counts x[] from examples with different lengths omega[].
 void setPDF(java.lang.String pdf)
          Set PDF to the desired value
 void setREF_LENGTH(double desiredLength)
          Set REF_LENGTH to the desired value
 void setSchema(ExampleSchema schema)
          Accept an ExampleSchema - constraints on what the Examples will be.
 double T1(int x1, int x2)
          Compute the T1 statistic corresponding to the counts in two texts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

T1InstanceTransformLearner

public T1InstanceTransformLearner()
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

getLength

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


T1

public double T1(int x1,
                 int x2)
Compute the T1 statistic corresponding to the counts in two texts


MaximumLikelihoodPoisson

public double MaximumLikelihoodPoisson(double[] x,
                                       double[] omega,
                                       double prior)
Compute the maximum likelihood estimate of the rate 'mu' of a Poisson model, using integer counts x[] from examples with different lengths omega[].


MethodOfMomentsNegBin

public java.util.SortedMap<java.lang.String,java.lang.Double> MethodOfMomentsNegBin(double[] x,
                                                                                    double[] omega,
                                                                                    double prior)
Compute the method of moment estimates of the rate 'mu' and the parameter which controls the variability 'delta' of a Negative-Binomial models, using integer counts x[] from examples with different lengths omega[].


setREF_LENGTH

public void setREF_LENGTH(double desiredLength)
Set REF_LENGTH to the desired value


setPDF

public void setPDF(java.lang.String pdf)
Set PDF to the desired value


main

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