private double[] prepareExtendedBatch(ExampleSet extendedBatch){
  int[] classCount=new int[2];
  Iterator<Example> reader=extendedBatch.iterator();
  while (reader.hasNext()) {
    Example example=reader.next();
    example.setWeight(1);
    classCount[(int)example.getLabel()]++;
  }
  double[] classPriors=new double[2];
  int sum=classCount[0] + classCount[1];
  classPriors[0]=(double)classCount[0] / sum;
  classPriors[1]=(double)classCount[1] / sum;
  return classPriors;
}

private double [ ] prepareExtendedBatch ( ExampleSet extendedBatch ) { int [ ] classCount = new int [ 2 ] ; Iterator < Example > reader = extendedBatch . iterator ( ) ; while ( reader . hasNext ( ) ) { Example example = reader . next ( ) ; example . setWeight ( 1 ) ; classCount [ ( int ) example . getLabel ( ) ] ++ ; } double [ ] classPriors = new double [ 2 ] ; int sum = classCount [ 0 ] + classCount [ 1 ] ; classPriors [ 0 ] = ( double ) classCount [ 0 ] / sum ; classPriors [ 1 ] = ( double ) classCount [ 1 ] / sum ; return classPriors ; }
similar to preparebatch , but for extended batches .
