Package opennlp.tools.doccat
Class DoccatCrossValidator
java.lang.Object
opennlp.tools.doccat.DoccatCrossValidator
Cross validator for 
DocumentCategorizer.- 
Constructor SummaryConstructorsConstructorDescriptionDoccatCrossValidator(String languageCode, TrainingParameters mlParams, DoccatFactory factory, DoccatEvaluationMonitor... listeners) Instantiates aDoccatCrossValidatorwith the givengenerators.
- 
Method SummaryModifier and TypeMethodDescriptionvoidevaluate(ObjectStream<DocumentSample> samples, int nFolds) Starts the evaluation.doublelong
- 
Constructor Details- 
DoccatCrossValidatorpublic DoccatCrossValidator(String languageCode, TrainingParameters mlParams, DoccatFactory factory, DoccatEvaluationMonitor... listeners) Instantiates aDoccatCrossValidatorwith the givengenerators.- Parameters:
- languageCode- An ISO conform language code.
- mlParams- The- TrainingParametersfor the context of cross validation.
- factory- The- DoccatFactoryfor creating related objects.
- listeners- the- evaluation listeners.
 
 
- 
- 
Method Details- 
evaluateStarts the evaluation.- Parameters:
- samples- The- ObjectStreamof- samplesto train and test with.
- nFolds- Number of folds. It must be greater than zero.
- Throws:
- IOException- Thrown if IO errors occurred.
 
- 
getDocumentAccuracypublic double getDocumentAccuracy()- Returns:
- Retrieves the accuracy for all iterations.
 
- 
getDocumentCountpublic long getDocumentCount()- Returns:
- 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.
 
 
-