mark.nlp.features
Class Reducer

java.lang.Object
  |
  +--mark.nlp.features.Reducer

public class Reducer
extends java.lang.Object

Provides a routine that eliminates from a set of potential features those potential features that occur too seldom or too often.


Constructor Summary
Reducer()
           
 
Method Summary
static ObjectMap reduce(Bag counts, ObjectMap potentialFeatures, int rareMax, int numCommon)
          Eliminates from a set of potential features those potential features that occur too seldom or too often.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reducer

public Reducer()
Method Detail

reduce

public static ObjectMap reduce(Bag counts,
                               ObjectMap potentialFeatures,
                               int rareMax,
                               int numCommon)
Eliminates from a set of potential features those potential features that occur too seldom or too often.

Parameters:
counts - a bag that contains the count for each feature.
potentialFeatures - the potential features.
rareMax - if a feature occurs this many times or fewer, it will be eliminated.
numCommon - the most common features will be eliminated. This number defines how many.
Returns:
the new subset of potential features. If both rareMax and numCommon are less than one, then returns potentialFeatures.