|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--dragon.ir.classification.featureselection.AbstractFeatureSelector
Abstract function class for feature selection
Copyright: Copyright (c) 2005
Company: IST, Drexel University
| Field Summary | |
protected int[] |
featureMap
|
protected int |
selectedFeatureNum
|
| Constructor Summary | |
AbstractFeatureSelector()
|
|
| Method Summary | |
protected DoubleVector |
getClassPrior(DocClassSet docSet)
|
int |
getSelectedFeatureNum()
|
protected abstract int[] |
getSelectedFeatures(IndexReader indexReader,
DocClassSet trainingSet)
|
protected abstract int[] |
getSelectedFeatures(SparseMatrix doctermMatrix,
DocClassSet trainingSet)
|
protected IntDenseMatrix |
getTermDistribution(IndexReader indexReader,
DocClassSet trainingSet)
|
protected IntDenseMatrix |
getTermDistribution(SparseMatrix doctermMatrix,
DocClassSet trainingSet)
|
protected int[] |
getTermDocFrequency(SparseMatrix matrix,
DocClassSet trainingSet)
|
boolean |
isSelected(int originalFeatureIndex)
|
int |
map(int originalFeatureIndex)
Map the old feature index to the index in the new feature space. |
void |
setSelectedFeatures(int[] selectedFeatures)
Manually set selected features. |
void |
train(IndexReader indexReader,
DocClassSet trainingSet)
This method chooses a subset of features for text classification |
void |
train(SparseMatrix doctermMatrix,
DocClassSet trainingSet)
This method chooses a subset of features for text classification. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int[] featureMap
protected int selectedFeatureNum
| Constructor Detail |
public AbstractFeatureSelector()
| Method Detail |
protected abstract int[] getSelectedFeatures(IndexReader indexReader,
DocClassSet trainingSet)
protected abstract int[] getSelectedFeatures(SparseMatrix doctermMatrix,
DocClassSet trainingSet)
public void train(IndexReader indexReader,
DocClassSet trainingSet)
FeatureSelector
train in interface FeatureSelectorindexReader - the index reader a classifer is working ontrainingSet - the labeled training document set
public void train(SparseMatrix doctermMatrix,
DocClassSet trainingSet)
FeatureSelector
train in interface FeatureSelectordoctermMatrix - the document-term matrix a classifer is working ontrainingSet - the labeled training document setpublic void setSelectedFeatures(int[] selectedFeatures)
FeatureSelector
setSelectedFeatures in interface FeatureSelectorselectedFeatures - each elements contains the index of the selected feature in the old feature space.
The selected feature must be in the ascending order in the input array.public boolean isSelected(int originalFeatureIndex)
isSelected in interface FeatureSelectororiginalFeatureIndex - the index of the feature in the old feature space
public int map(int originalFeatureIndex)
FeatureSelector
map in interface FeatureSelectororiginalFeatureIndex - the index of the feature before feature selection
public int getSelectedFeatureNum()
getSelectedFeatureNum in interface FeatureSelectorprotected DoubleVector getClassPrior(DocClassSet docSet)
protected int[] getTermDocFrequency(SparseMatrix matrix,
DocClassSet trainingSet)
protected IntDenseMatrix getTermDistribution(IndexReader indexReader,
DocClassSet trainingSet)
protected IntDenseMatrix getTermDistribution(SparseMatrix doctermMatrix,
DocClassSet trainingSet)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||