org.cogroo.tools.featurizer
Class FeaturizerCrossValidator

java.lang.Object
  extended by org.cogroo.tools.featurizer.FeaturizerCrossValidator

public class FeaturizerCrossValidator
extends Object


Constructor Summary
FeaturizerCrossValidator(String languageCode, opennlp.tools.util.TrainingParameters params, FeatureDictionary dict, String cgFlags, String factoryClass, FeaturizerEvaluationMonitor... listeners)
           
 
Method Summary
 void evaluate(opennlp.tools.util.ObjectStream<FeatureSample> samples, int nFolds)
          Starts the evaluation.
 double getWordAccuracy()
          Retrieves the accuracy for all iterations.
 long getWordCount()
          Retrieves the number of words which where validated over all iterations.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeaturizerCrossValidator

public FeaturizerCrossValidator(String languageCode,
                                opennlp.tools.util.TrainingParameters params,
                                FeatureDictionary dict,
                                String cgFlags,
                                String factoryClass,
                                FeaturizerEvaluationMonitor... listeners)
Method Detail

evaluate

public void evaluate(opennlp.tools.util.ObjectStream<FeatureSample> samples,
                     int nFolds)
              throws IOException,
                     opennlp.tools.util.InvalidFormatException,
                     IOException
Starts the evaluation.

Parameters:
samples - the data to train and test
nFolds - number of folds
Throws:
IOException
opennlp.tools.util.InvalidFormatException

getWordAccuracy

public double getWordAccuracy()
Retrieves the accuracy for all iterations.

Returns:
the word accuracy

getWordCount

public long getWordCount()
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


Copyright © 2012-2013 CoGrOO. All Rights Reserved.