public Table[] sampleSplit(double table1Proportion){
  Table[] tables=new Table[2];
  int table1Count=(int)Math.round(rowCount() * table1Proportion);
  Selection table2Selection=new BitmapBackedSelection();
  for (int i=0; i < rowCount(); i++) {
    table2Selection.add(i);
  }
  Selection table1Selection=new BitmapBackedSelection();
  int[] table1Records=generateUniformBitmap(table1Count,rowCount());
  for (int i=0; i < table1Records.length; i++) {
    table1Selection.add(table1Records[i]);
  }
  table2Selection.andNot(table1Selection);
  tables[0]=selectWhere(table1Selection);
  tables[1]=selectWhere(table2Selection);
  return tables;
}

public Table [ ] sampleSplit ( double table1Proportion ) { Table [ ] tables = new Table [ 2 ] ; int table1Count = ( int ) Math . round ( rowCount ( ) * table1Proportion ) ; Selection table2Selection = new BitmapBackedSelection ( ) ; for ( int i = 0 ; i < rowCount ( ) ; i ++ ) { table2Selection . add ( i ) ; } Selection table1Selection = new BitmapBackedSelection ( ) ; int [ ] table1Records = generateUniformBitmap ( table1Count , rowCount ( ) ) ; for ( int i = 0 ; i < table1Records . length ; i ++ ) { table1Selection . add ( table1Records [ i ] ) ; } table2Selection . andNot ( table1Selection ) ; tables [ 0 ] = selectWhere ( table1Selection ) ; tables [ 1 ] = selectWhere ( table2Selection ) ; return tables ; }
splits the table into two , randomly assigning records to each according to the proportion given in trainingproportion
