protected boolean[] datasetIntegrity(AttrTypes attrTypes,int classType,boolean attributeMissing,boolean classMissing){
  Estimator estimator=null;
  print("estimator doesn't alter original datasets");
  printAttributeSummary(attrTypes,classType);
  print("...");
  int numTrain=getNumInstances();
  getNumInstances();
  int numClasses=2, missingLevel=100;
  boolean[] result=new boolean[2];
  Instances train=null;
  boolean built=false;
  try {
    train=makeTestDataset(42,numTrain,1,attrTypes,numClasses,classType);
    int attrIndex=0;
    if (missingLevel > 0) {
      addMissing(train,missingLevel,attributeMissing,classMissing,attrIndex);
    }
    estimator=Estimator.makeCopies(getEstimator(),1)[0];
  }
 catch (  Exception ex) {
    throw new Error("Error setting up for tests: " + ex.getMessage());
  }
  try {
    Instances trainCopy=new Instances(train);
    int attrIndex=0;
    estimator.addValues(trainCopy,attrIndex);
    compareDatasets(train,trainCopy);
    built=true;
    println("yes");
    result[0]=true;
  }
 catch (  Exception ex) {
    println("no");
    result[0]=false;
    if (m_Debug) {
      println("\n=== Full Report ===");
      print("Problem during");
      if (built) {
        print(" testing");
      }
 else {
        print(" training");
      }
      println(": " + ex.getMessage() + "\n");
      println("Here are the datasets:\n");
      println("=== Train Dataset ===\n" + train.toString() + "\n");
    }
  }
  return result;
}

protected boolean [ ] datasetIntegrity ( AttrTypes attrTypes , int classType , boolean attributeMissing , boolean classMissing ) { Estimator estimator = null ; print ( "estimator doesn't alter original datasets" ) ; printAttributeSummary ( attrTypes , classType ) ; print ( "..." ) ; int numTrain = getNumInstances ( ) ; getNumInstances ( ) ; int numClasses = 2 , missingLevel = 100 ; boolean [ ] result = new boolean [ 2 ] ; Instances train = null ; boolean built = false ; try { train = makeTestDataset ( 42 , numTrain , 1 , attrTypes , numClasses , classType ) ; int attrIndex = 0 ; if ( missingLevel > 0 ) { addMissing ( train , missingLevel , attributeMissing , classMissing , attrIndex ) ; } estimator = Estimator . makeCopies ( getEstimator ( ) , 1 ) [ 0 ] ; } catch ( Exception ex ) { throw new Error ( "Error setting up for tests: " + ex . getMessage ( ) ) ; } try { Instances trainCopy = new Instances ( train ) ; int attrIndex = 0 ; estimator . addValues ( trainCopy , attrIndex ) ; compareDatasets ( train , trainCopy ) ; built = true ; println ( "yes" ) ; result [ 0 ] = true ; } catch ( Exception ex ) { println ( "no" ) ; result [ 0 ] = false ; if ( m_Debug ) { println ( "\n=== Full Report ===" ) ; print ( "Problem during" ) ; if ( built ) { print ( " testing" ) ; } else { print ( " training" ) ; } println ( ": " + ex . getMessage ( ) + "\n" ) ; println ( "Here are the datasets:\n" ) ; println ( "=== Train Dataset ===\n" + train . toString ( ) + "\n" ) ; } } return result ; }
checks whether the scheme alters the training dataset during training . if the scheme needs to modify the training data it should take a copy of the training data . currently checks for changes to header structure , number of instances , order of instances , instance weights .
