Package opennlp.tools.doccat
Class DoccatCrossValidator
- java.lang.Object
-
- opennlp.tools.doccat.DoccatCrossValidator
-
public class DoccatCrossValidator extends Object
Cross validator for document categorization
-
-
Constructor Summary
Constructors Constructor Description DoccatCrossValidator(String languageCode, TrainingParameters mlParams, DoccatFactory factory, DoccatEvaluationMonitor... listeners)
Creates aDoccatCrossValidator
with the givenFeatureGenerator
s.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
evaluate(ObjectStream<DocumentSample> samples, int nFolds)
Starts the evaluation.double
getDocumentAccuracy()
Retrieves the accuracy for all iterations.long
getDocumentCount()
Retrieves the number of words which where validated over all iterations.
-
-
-
Constructor Detail
-
DoccatCrossValidator
public DoccatCrossValidator(String languageCode, TrainingParameters mlParams, DoccatFactory factory, DoccatEvaluationMonitor... listeners)
Creates aDoccatCrossValidator
with the givenFeatureGenerator
s.
-
-
Method Detail
-
evaluate
public void evaluate(ObjectStream<DocumentSample> samples, int nFolds) throws IOException
Starts the evaluation.- Parameters:
samples
- the data to train and testnFolds
- number of folds- Throws:
IOException
-
getDocumentAccuracy
public double getDocumentAccuracy()
Retrieves the accuracy for all iterations.- Returns:
- the word accuracy
-
getDocumentCount
public long getDocumentCount()
Retrieves the number of words which where validated over all iterations. The result is the amount of folds multiplied by the total number of words.- Returns:
- the word count
-
-