SentimentCrossValidator (Apache OpenNLP :: Core :: Runtime 3.0.0-M4 API)
Description: declaration: package: opennlp.tools.sentiment, class: SentimentCrossValidator

Package opennlp.tools.sentiment

# Class SentimentCrossValidator

java.lang.Object
opennlp.tools.sentiment.SentimentCrossValidator

public class SentimentCrossValidator extends Object
Class for performing cross validation on the Sentiment Analysis Parser.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SentimentCrossValidator(String lang, opennlp.tools.util.TrainingParameters params, SentimentFactory factory, opennlp.tools.sentiment.SentimentEvaluationMonitor[] monitors)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `evaluate(opennlp.tools.util.ObjectStream<opennlp.tools.sentiment.SentimentSample> samples, int nFolds)`
  Performs evaluation
  `opennlp.tools.util.eval.FMeasure`
  `getFMeasure()`
  Returns the F-Measure

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### SentimentCrossValidator

    public SentimentCrossValidator(String lang, opennlp.tools.util.TrainingParameters params, SentimentFactory factory, opennlp.tools.sentiment.SentimentEvaluationMonitor[] monitors)
    Constructor

- ## Method Details

  - ### evaluate

    public void evaluate(opennlp.tools.util.ObjectStream<opennlp.tools.sentiment.SentimentSample> samples, int nFolds) throws IOException
    Performs evaluation
    Parameters:
      `samples` - stream of SentimentSamples
      `nFolds` - the number of folds to be used in cross validation
    Throws:
      `IOException`

  - ### getFMeasure

    public opennlp.tools.util.eval.FMeasure getFMeasure()
    Returns the F-Measure
    Returns:
      the F-Measure