|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--dragon.ir.classification.AbstractClassifier
Basic function class for classifying
Copyright: Copyright (c) 2005
Company: IST, Drexel University
| Field Summary | |
protected java.lang.String[] |
arrLabel
|
protected int |
classNum
|
protected SparseMatrix |
doctermMatrix
|
protected FeatureSelector |
featureSelector
|
protected IndexReader |
indexReader
|
protected DocClassSet |
validatingDocSet
|
| Constructor Summary | |
AbstractClassifier()
|
|
AbstractClassifier(IndexReader indexReader)
|
|
AbstractClassifier(SparseMatrix doctermMatrix)
|
|
| Method Summary | |
DocClassSet |
classify(DocClass testingDocs)
This method uses the trained model to classify the testing documents. |
DocClassSet |
classify(DocClassSet trainingDocSet,
DocClass testingDocs)
This method trains the classifier with the training document set and then using the trained model to classify the testing documents. |
DocClassSet |
classify(DocClassSet trainingDocSet,
DocClassSet validatingDocSet,
DocClass testingDocs)
|
int |
classify(IRDoc doc)
Classify one particular document |
java.lang.String |
getClassLabel(int index)
Gets the label of a given document category |
SparseMatrix |
getDocTermMatrix()
|
FeatureSelector |
getFeatureSelector()
|
IndexReader |
getIndexReader()
|
protected Row |
getRow(int docIndex)
|
void |
setFeatureSelector(FeatureSelector selector)
|
void |
train(DocClassSet trainingDocSet,
DocClassSet validatingDocSet)
This method trains the classifier with the training document set and validating document set. |
protected void |
trainFeatureSelector(DocClassSet trainingSet)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface dragon.ir.classification.Classifier |
classify, rank, saveModel, train |
| Field Detail |
protected IndexReader indexReader
protected SparseMatrix doctermMatrix
protected DocClassSet validatingDocSet
protected FeatureSelector featureSelector
protected java.lang.String[] arrLabel
protected int classNum
| Constructor Detail |
public AbstractClassifier(IndexReader indexReader)
public AbstractClassifier(SparseMatrix doctermMatrix)
public AbstractClassifier()
| Method Detail |
public java.lang.String getClassLabel(int index)
Classifier
getClassLabel in interface Classifierindex - the index of the category
public IndexReader getIndexReader()
getIndexReader in interface Classifierpublic SparseMatrix getDocTermMatrix()
public FeatureSelector getFeatureSelector()
getFeatureSelector in interface Classifierpublic void setFeatureSelector(FeatureSelector selector)
setFeatureSelector in interface Classifierselector - the feature selector for the classifier.
public DocClassSet classify(DocClassSet trainingDocSet,
DocClass testingDocs)
Classifier
classify in interface ClassifiertrainingDocSet - training document settestingDocs - testing document set
public DocClassSet classify(DocClassSet trainingDocSet,
DocClassSet validatingDocSet,
DocClass testingDocs)
classify in interface ClassifiertrainingDocSet - the training document setvalidatingDocSet - the validation document set, usually for avoiding the overfitting problemtestingDocs - the testing document set
public void train(DocClassSet trainingDocSet,
DocClassSet validatingDocSet)
Classifier
train in interface ClassifiertrainingDocSet - training document setvalidatingDocSet - validating document setpublic DocClassSet classify(DocClass testingDocs)
Classifier
classify in interface ClassifiertestingDocs - testing document set
public int classify(IRDoc doc)
Classifier
classify in interface Classifierdoc - the index of the document is stored in the IRDoc object
protected Row getRow(int docIndex)
protected void trainFeatureSelector(DocClassSet trainingSet)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||