dragon.ir.clustering.featurefilter
Class AbstractFeatureFilter

java.lang.Object
  |
  +--dragon.ir.clustering.featurefilter.AbstractFeatureFilter
All Implemented Interfaces:
FeatureFilter
Direct Known Subclasses:
DocFrequencyFilter, NullFeatureFilter

public abstract class AbstractFeatureFilter
extends java.lang.Object
implements FeatureFilter

Title:

Description:

Copyright: Copyright (c) 2005

Company: IST, Drexel University

Version:
1.0
Author:
Davis Zhou

Field Summary
protected  int[] featureMap
           
protected  int selectedFeatureNum
           
 
Constructor Summary
AbstractFeatureFilter()
           
 
Method Summary
 int getSelectedFeatureNum()
           
protected abstract  int[] getSelectedFeatures(IndexReader indexReader, IRDoc[] docSet)
           
 void initialize(IndexReader indexReader, IRDoc[] docSet)
          This method chooses a subset of features for text clustering
 boolean isSelected(int originalFeatureIndex)
           
 int map(int originalFeatureIndex)
          Map the old feature index to the index in the new feature space.
protected  void setSelectedFeatures(int[] selectedFeatures)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

featureMap

protected int[] featureMap

selectedFeatureNum

protected int selectedFeatureNum
Constructor Detail

AbstractFeatureFilter

public AbstractFeatureFilter()
Method Detail

getSelectedFeatures

protected abstract int[] getSelectedFeatures(IndexReader indexReader,
                                             IRDoc[] docSet)

initialize

public void initialize(IndexReader indexReader,
                       IRDoc[] docSet)
Description copied from interface: FeatureFilter
This method chooses a subset of features for text clustering

Specified by:
initialize in interface FeatureFilter
Parameters:
indexReader - the index reader for a collection
docSet - the document set for clustering

setSelectedFeatures

protected void setSelectedFeatures(int[] selectedFeatures)

isSelected

public boolean isSelected(int originalFeatureIndex)
Specified by:
isSelected in interface FeatureFilter
Parameters:
originalFeatureIndex - the index of the feature in the old feature space
Returns:
true if the given feature is selected for text clustering

map

public int map(int originalFeatureIndex)
Description copied from interface: FeatureFilter
Map the old feature index to the index in the new feature space.

Specified by:
map in interface FeatureFilter
Parameters:
originalFeatureIndex - the index of the feature before feature selection
Returns:
the index of the feature the new space. If the feature is not selected, it will return -1.

getSelectedFeatureNum

public int getSelectedFeatureNum()
Specified by:
getSelectedFeatureNum in interface FeatureFilter
Returns:
the number of selected features