result[0] = true; result[1] = true;
result[0] = (stage < 1); result[1] = (stage < 1);
  protected boolean[] correctBuildInitialisation(      boolean nominalPredictor,      boolean numericPredictor,       boolean stringPredictor,       boolean datePredictor,      boolean relationalPredictor,      boolean multiInstance,      int classType) {    boolean[] result = new boolean[2];        print("correct initialisation during buildClassifier");    printAttributeSummary(        nominalPredictor, numericPredictor, stringPredictor, datePredictor, relationalPredictor, multiInstance, classType);    print("...");    int numTrain = getNumInstances(), numTest = getNumInstances(),     numClasses = 2, missingLevel = 0;    boolean predictorMissing = false, classMissing = false;        Instances train1 = null;    Instances test1 = null;    Instances train2 = null;    Instances test2 = null;    Classifier classifier = null;    Evaluation evaluation1A = null;    Evaluation evaluation1B = null;    Evaluation evaluation2 = null;    boolean built = false;    int stage = 0;    try {            // Make two sets of train/test splits with different       // numbers of attributes      train1 = makeTestDataset(42, numTrain,                                nominalPredictor    ? getNumNominal()    : 0,                               numericPredictor    ? getNumNumeric()    : 0,                                stringPredictor     ? getNumString()     : 0,                                datePredictor       ? getNumDate()       : 0,                                relationalPredictor ? getNumRelational() : 0,                                numClasses,                                classType,                               multiInstance);      train2 = makeTestDataset(84, numTrain,                                nominalPredictor    ? getNumNominal() + 1 : 0,                               numericPredictor    ? getNumNumeric() + 1 : 0,                                stringPredictor     ? getNumString()      : 0,                                datePredictor       ? getNumDate()        : 0,                                relationalPredictor ? getNumRelational()  : 0,                                numClasses,                                classType,                               multiInstance);      test1 = makeTestDataset(24, numTest,                              nominalPredictor     ? getNumNominal()    : 0,                              numericPredictor     ? getNumNumeric()    : 0,                               stringPredictor      ? getNumString()     : 0,                               datePredictor        ? getNumDate()       : 0,                               relationalPredictor  ? getNumRelational() : 0,                               numClasses,                               classType,                              multiInstance);      test2 = makeTestDataset(48, numTest,                              nominalPredictor    ? getNumNominal() + 1 : 0,                              numericPredictor    ? getNumNumeric() + 1 : 0,                               stringPredictor     ? getNumString()      : 0,                               datePredictor       ? getNumDate()        : 0,                               relationalPredictor ? getNumRelational()  : 0,                               numClasses,                               classType,                              multiInstance);      if (missingLevel > 0) {        addMissing(train1, missingLevel, predictorMissing, classMissing);        addMissing(test1, Math.min(missingLevel,50), predictorMissing,             classMissing);        addMissing(train2, missingLevel, predictorMissing, classMissing);        addMissing(test2, Math.min(missingLevel,50), predictorMissing,             classMissing);      }            classifier = Classifier.makeCopies(getClassifier(), 1)[0];      evaluation1A = new Evaluation(train1);      evaluation1B = new Evaluation(train1);      evaluation2 = new Evaluation(train2);    } catch (Exception ex) {      throw new Error("Error setting up for tests: " + ex.getMessage());    }    try {      stage = 0;      classifier.buildClassifier(train1);      built = true;      if (!testWRTZeroR(classifier, evaluation1A, train1, test1)[0]) {        throw new Exception("Scheme performs worse than ZeroR");      }            stage = 1;      built = false;      classifier.buildClassifier(train2);      built = true;      if (!testWRTZeroR(classifier, evaluation2, train2, test2)[0]) {        throw new Exception("Scheme performs worse than ZeroR");      }            stage = 2;      built = false;      classifier.buildClassifier(train1);      built = true;      if (!testWRTZeroR(classifier, evaluation1B, train1, test1)[0]) {        throw new Exception("Scheme performs worse than ZeroR");      }            stage = 3;      if (!evaluation1A.equals(evaluation1B)) {        if (m_Debug) {          println("\n=== Full report ===\n"              + evaluation1A.toSummaryString("\nFirst buildClassifier()",                  true)                  + "\n\n");          println(              evaluation1B.toSummaryString("\nSecond buildClassifier()",                  true)                  + "\n\n");        }        throw new Exception("Results differ between buildClassifier calls");      }      println("yes");      result[0] = true;            if (false && m_Debug) {        println("\n=== Full report ===\n"            + evaluation1A.toSummaryString("\nFirst buildClassifier()",                true)                + "\n\n");        println(            evaluation1B.toSummaryString("\nSecond buildClassifier()",                true)                + "\n\n");      }    }     catch (Exception ex) {      String msg = ex.getMessage().toLowerCase();      if (msg.indexOf("worse than zeror") >= 0) {        println("warning: performs worse than ZeroR");        result[0] = true;        result[1] = true;      } else {        println("no");        result[0] = false;      }      if (m_Debug) {        println("\n=== Full Report ===");        print("Problem during");        if (built) {          print(" testing");        } else {          print(" training");        }        switch (stage) {          case 0:            print(" of dataset 1");            break;          case 1:            print(" of dataset 2");            break;          case 2:            print(" of dataset 1 (2nd build)");            break;          case 3:            print(", comparing results from builds of dataset 1");            break;	          }        println(": " + ex.getMessage() + "\n");        println("here are the datasets:\n");        println("=== Train1 Dataset ===\n"            + train1.toString() + "\n");        println("=== Test1 Dataset ===\n"            + test1.toString() + "\n\n");        println("=== Train2 Dataset ===\n"            + train2.toString() + "\n");        println("=== Test2 Dataset ===\n"            + test2.toString() + "\n\n");      }    }        return result;  }