private double evaluatePredictions(ExampleSet exampleSet){
  Iterator<Example> reader=exampleSet.iterator();
  int count=0;
  int correct=0;
  while (reader.hasNext()) {
    count++;
    Example example=reader.next();
    if (example.getLabel() == example.getPredictedLabel()) {
      correct++;
    }
  }
  return (double)correct / count;
}

private double evaluatePredictions ( ExampleSet exampleSet ) { Iterator < Example > reader = exampleSet . iterator ( ) ; int count = 0 ; int correct = 0 ; while ( reader . hasNext ( ) ) { count ++ ; Example example = reader . next ( ) ; if ( example . getLabel ( ) == example . getPredictedLabel ( ) ) { correct ++ ; } } return ( double ) correct / count ; }
returns the accuracy of the predictions for the given example set
