code: public void evaluate(ObjectStream<FeatureSample> samples, int nFolds)
        throws IOException, InvalidFormatException, IOException {
      CrossValidationPartitioner<FeatureSample> partitioner = new CrossValidationPartitioner<FeatureSample>(
          samples, nFolds);
  
      while (partitioner.hasNext()) {
  
        CrossValidationPartitioner.TrainingSampleStream<FeatureSample> trainingSampleStream = partitioner
            .next();
        
        if (this.factory == null) {
          this.factory = FeaturizerFactory.create(this.factoryClassName, posDict, cgFlags);
        }
  
        FeaturizerModel model = FeaturizerME.train(languageCode,
            trainingSampleStream, this.params, factory);
  
        // do testing
        FeaturizerEvaluator evaluator = new FeaturizerEvaluator(new FeaturizerME(
            model), listeners);
  
        evaluator.evaluate(trainingSampleStream.getTestSampleStream());
  
        wordAccuracy.add(evaluator.getWordAccuracy(), evaluator.getWordCount());
      }
    }
docs: Starts the evaluation.
  
  @param samples
  the data to train and test
  @param nFolds
  number of folds
  
  @throws IOException