ir.classifiers
Class Rocchio
java.lang.Object
|
+--ir.classifiers.Classifier
|
+--ir.classifiers.Rocchio
- public class Rocchio
- extends Classifier
Method Summary |
java.lang.String |
getName()
Returns the name |
void |
setInvertedIndex(ir.vsr.InvertedIndex index)
For classifiers that use invertedIndices, this function sets
them -- needed for efficient memory management |
boolean |
test(Example testExample)
Returns true if the predicted category of the test example matches the correct category,
false otherwise |
void |
train(java.util.Vector train)
Trains the classifier on the training examples |
boolean |
usesInvertedIndex()
Function to indicate that this class uses an inverted index |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
name
public java.lang.String name
trainDocs
protected ir.vsr.InvertedIndex trainDocs
K
protected int K
rocchioMeanVectors
protected java.util.ArrayList rocchioMeanVectors
usesInvertedIndex
public boolean usesInvertedIndex()
- Function to indicate that this class uses an inverted index
- Overrides:
usesInvertedIndex
in class Classifier
setInvertedIndex
public void setInvertedIndex(ir.vsr.InvertedIndex index)
- Description copied from class:
Classifier
- For classifiers that use invertedIndices, this function sets
them -- needed for efficient memory management
- Overrides:
setInvertedIndex
in class Classifier
getName
public java.lang.String getName()
- Returns the name
- Overrides:
getName
in class Classifier
train
public void train(java.util.Vector train)
- Description copied from class:
Classifier
- Trains the classifier on the training examples
- Overrides:
train
in class Classifier
test
public boolean test(Example testExample)
- Description copied from class:
Classifier
- Returns true if the predicted category of the test example matches the correct category,
false otherwise
- Overrides:
test
in class Classifier