edu.cmu.minorthird.classify.transform
Class ChiSquareInstanceTransform

java.lang.Object
  extended by edu.cmu.minorthird.classify.transform.AbstractInstanceTransform
      extended by edu.cmu.minorthird.classify.transform.ChiSquareInstanceTransform
All Implemented Interfaces:
InstanceTransform

public class ChiSquareInstanceTransform
extends AbstractInstanceTransform

Author:
Vitor R. Carvalho Date: March 2005 A simple feature filter based on Chi-squared statistic.

Constructor Summary
ChiSquareInstanceTransform()
          Default Constructor - numFeatures=100
ChiSquareInstanceTransform(int num)
          Constructor - parameter is number of features
 
Method Summary
 void addFeature(double infoGain, Feature f)
          Adds a score of feature f to the InstanceTransform
 Feature[] getTopFeatures(int top)
          get top ranked features
 void setNumberOfFeatures(int number)
          Number of features with the highest scores to keep in the dataset
 java.lang.String toString(int top)
          displays the top ranked features and their scores
 Instance transform(Instance ins)
          Transform an instance according to Info-Gain criterion
 
Methods inherited from class edu.cmu.minorthird.classify.transform.AbstractInstanceTransform
transform, transform, transform, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChiSquareInstanceTransform

public ChiSquareInstanceTransform()
Default Constructor - numFeatures=100


ChiSquareInstanceTransform

public ChiSquareInstanceTransform(int num)
Constructor - parameter is number of features

Method Detail

transform

public Instance transform(Instance ins)
Transform an instance according to Info-Gain criterion

Specified by:
transform in interface InstanceTransform
Specified by:
transform in class AbstractInstanceTransform

toString

public java.lang.String toString(int top)
displays the top ranked features and their scores


getTopFeatures

public Feature[] getTopFeatures(int top)
get top ranked features


setNumberOfFeatures

public void setNumberOfFeatures(int number)
Number of features with the highest scores to keep in the dataset


addFeature

public void addFeature(double infoGain,
                       Feature f)
Adds a score of feature f to the InstanceTransform