// Path: src/main/java/weka/classifiers/evaluation/CollectiveEvaluationUtils.java
// public class CollectiveEvaluationUtils
//   extends EvaluationUtils {
// 
//   /**
//    * Generate a bunch of predictions ready for processing, by performing a
//    * evaluation on a test set after training on the given training set.
//    *
//    * @param classifier the Classifier to evaluate
//    * @param train the training dataset
//    * @param test the test dataset
//    * @exception Exception if an error occurs
//    */
//   @Override
//   public ArrayList<Prediction> getTrainTestPredictions(Classifier classifier, 
//                                             Instances train, Instances test) 
//     throws Exception {
//     
//     if (classifier instanceof CollectiveClassifier) {
//       CollectiveClassifier c = (CollectiveClassifier) classifier;
//       c.reset();
//       c.setTestSet(test);
//     }
// 
//     return super.getTrainTestPredictions(classifier, train, test);
//   }
// 
//   /**
//    * runs the classifier instance with the given options.
//    *
//    * @param classifier	the classifier to run
//    * @param options	the commandline options
//    */
//   public static void runClassifier(CollectiveClassifier classifier, String[] options) {
//     try {
//       System.out.println(CollectiveEvaluation.evaluateModel(classifier, options));
//     }
//     catch (Exception e) {
//       if (    ((e.getMessage() != null) && (e.getMessage().indexOf("General options") == -1))
//           || (e.getMessage() == null) )
//         e.printStackTrace();
//       else
//         System.err.println(e.getMessage());
//     }
//   }
//   
//   /**
//    * Returns the revision string.
//    * 
//    * @return		the revision
//    */
//   @Override
//   public String getRevision() {
//     return RevisionUtils.extract("$Revision: 2019 $");
//   }
// }


import java.util.ArrayList;
import weka.classifiers.AbstractClassifierTest;
import weka.classifiers.CheckClassifier;
import weka.classifiers.Classifier;
import weka.classifiers.evaluation.CollectiveEvaluationUtils;
import weka.classifiers.evaluation.EvaluationUtils;
import weka.classifiers.evaluation.Prediction;
import weka.core.CheckGOE;
import weka.core.Instances;
  /**
   * Configures the CheckGOE used for testing GOE stuff.
   * 
   * @return	the fully configured CheckGOE
   */
  @Override
  protected CheckGOE getGOETester() {
    CheckGOE		result;
    
    result = super.getGOETester();
    result.setIgnoredProperties(result.getIgnoredProperties() + ",testSet");
    
    return result;
  }

  /**
   * Builds a model using the current classifier using the first
   * half of the current data for training, and generates a bunch of
   * predictions using the remaining half of the data for testing.
   *
   * @param data 	the instances to test the classifier on
   * @return a <code>FastVector</code> containing the predictions.
   */
  @Override
  protected ArrayList<Prediction> useClassifier(Instances data) throws Exception {
    Classifier dc = null;
    int tot = data.numInstances();
    int mid = tot / 2;
    Instances train = null;
    Instances test = null;
// Path: src/main/java/weka/classifiers/evaluation/CollectiveEvaluationUtils.java
// public class CollectiveEvaluationUtils
//   extends EvaluationUtils {
// 
//   /**
//    * Generate a bunch of predictions ready for processing, by performing a
//    * evaluation on a test set after training on the given training set.
//    *
//    * @param classifier the Classifier to evaluate
//    * @param train the training dataset
//    * @param test the test dataset
//    * @exception Exception if an error occurs
//    */
//   @Override
//   public ArrayList<Prediction> getTrainTestPredictions(Classifier classifier, 
//                                             Instances train, Instances test) 
//     throws Exception {
//     
//     if (classifier instanceof CollectiveClassifier) {
//       CollectiveClassifier c = (CollectiveClassifier) classifier;
//       c.reset();
//       c.setTestSet(test);
//     }
// 
//     return super.getTrainTestPredictions(classifier, train, test);
//   }
// 
//   /**
//    * runs the classifier instance with the given options.
//    *
//    * @param classifier	the classifier to run
//    * @param options	the commandline options
//    */
//   public static void runClassifier(CollectiveClassifier classifier, String[] options) {
//     try {
//       System.out.println(CollectiveEvaluation.evaluateModel(classifier, options));
//     }
//     catch (Exception e) {
//       if (    ((e.getMessage() != null) && (e.getMessage().indexOf("General options") == -1))
//           || (e.getMessage() == null) )
//         e.printStackTrace();
//       else
//         System.err.println(e.getMessage());
//     }
//   }
//   
//   /**
//    * Returns the revision string.
//    * 
//    * @return		the revision
//    */
//   @Override
//   public String getRevision() {
//     return RevisionUtils.extract("$Revision: 2019 $");
//   }
// }


// Path: src/test/java/weka/classifiers/collective/AbstractCollectiveClassifierTest.java
import java.util.ArrayList;
import weka.classifiers.AbstractClassifierTest;
import weka.classifiers.CheckClassifier;
import weka.classifiers.Classifier;
import weka.classifiers.evaluation.CollectiveEvaluationUtils;
import weka.classifiers.evaluation.EvaluationUtils;
import weka.classifiers.evaluation.Prediction;
import weka.core.CheckGOE;
import weka.core.Instances;

  /**
   * Configures the CheckGOE used for testing GOE stuff.
   * 
   * @return	the fully configured CheckGOE
   */
  @Override
  protected CheckGOE getGOETester() {
    CheckGOE		result;
    
    result = super.getGOETester();
    result.setIgnoredProperties(result.getIgnoredProperties() + ",testSet");
    
    return result;
  }

  /**
   * Builds a model using the current classifier using the first
   * half of the current data for training, and generates a bunch of
   * predictions using the remaining half of the data for testing.
   *
   * @param data 	the instances to test the classifier on
   * @return a <code>FastVector</code> containing the predictions.
   */
  @Override
  protected ArrayList<Prediction> useClassifier(Instances data) throws Exception {
    Classifier dc = null;
    int tot = data.numInstances();
    int mid = tot / 2;
    Instances train = null;
    Instances test = null;
    EvaluationUtils evaluation = new CollectiveEvaluationUtils();