private Instances defineDataset(Random random) throws Exception {
  boolean[] attList_Irr;
  int[] attList_Num;
  ArrayList<Attribute> attributes=new ArrayList<Attribute>();
  Attribute attribute;
  ArrayList<String> nominalValues=new ArrayList<String>(2);
  nominalValues.add("false");
  nominalValues.add("true");
  ArrayList<String> classValues=new ArrayList<String>(getNumClasses());
  Instances dataset;
  attList_Irr=defineIrrelevant(random);
  setAttList_Irr(attList_Irr);
  attList_Num=defineNumeric(random);
  for (int i=0; i < getNumAttributes(); i++) {
    if (attList_Num[i] == Attribute.NUMERIC) {
      attribute=new Attribute("a" + i);
    }
 else {
      attribute=new Attribute("a" + i,nominalValues);
    }
    attributes.add(attribute);
  }
  for (int i=0; i < getNumClasses(); i++) {
    classValues.add("c" + i);
  }
  attribute=new Attribute("class",classValues);
  attributes.add(attribute);
  dataset=new Instances(getRelationNameToUse(),attributes,getNumExamplesAct());
  dataset.setClassIndex(getNumAttributes());
  Instances format=new Instances(dataset,0);
  setDatasetFormat(format);
  return dataset;
}

private Instances defineDataset ( Random random ) throws Exception { boolean [ ] attList_Irr ; int [ ] attList_Num ; ArrayList < Attribute > attributes = new ArrayList < Attribute > ( ) ; Attribute attribute ; ArrayList < String > nominalValues = new ArrayList < String > ( 2 ) ; nominalValues . add ( "false" ) ; nominalValues . add ( "true" ) ; ArrayList < String > classValues = new ArrayList < String > ( getNumClasses ( ) ) ; Instances dataset ; attList_Irr = defineIrrelevant ( random ) ; setAttList_Irr ( attList_Irr ) ; attList_Num = defineNumeric ( random ) ; for ( int i = 0 ; i < getNumAttributes ( ) ; i ++ ) { if ( attList_Num [ i ] == Attribute . NUMERIC ) { attribute = new Attribute ( "a" + i ) ; } else { attribute = new Attribute ( "a" + i , nominalValues ) ; } attributes . add ( attribute ) ; } for ( int i = 0 ; i < getNumClasses ( ) ; i ++ ) { classValues . add ( "c" + i ) ; } attribute = new Attribute ( "class" , classValues ) ; attributes . add ( attribute ) ; dataset = new Instances ( getRelationNameToUse ( ) , attributes , getNumExamplesAct ( ) ) ; dataset . setClassIndex ( getNumAttributes ( ) ) ; Instances format = new Instances ( dataset , 0 ) ; setDatasetFormat ( format ) ; return dataset ; }
returns a dataset header .
