public static void trainEpochs(ClassificationDataSet dataSet,UpdateableClassifier toTrain,int epochs){
  if (epochs < 1)   throw new IllegalArgumentException("epochs must be positive");
  toTrain.setUp(dataSet.getCategories(),dataSet.getNumNumericalVars(),dataSet.getPredicting());
  IntList randomOrder=new IntList(dataSet.getSampleSize());
  ListUtils.addRange(randomOrder,0,dataSet.getSampleSize(),1);
  for (int epoch=0; epoch < epochs; epoch++) {
    Collections.shuffle(randomOrder);
    for (    int i : randomOrder)     toTrain.update(dataSet.getDataPoint(i),dataSet.getDataPointCategory(i));
  }
}

public static void trainEpochs ( ClassificationDataSet dataSet , UpdateableClassifier toTrain , int epochs ) { if ( epochs < 1 ) throw new IllegalArgumentException ( "epochs must be positive" ) ; toTrain . setUp ( dataSet . getCategories ( ) , dataSet . getNumNumericalVars ( ) , dataSet . getPredicting ( ) ) ; IntList randomOrder = new IntList ( dataSet . getSampleSize ( ) ) ; ListUtils . addRange ( randomOrder , 0 , dataSet . getSampleSize ( ) , 1 ) ; for ( int epoch = 0 ; epoch < epochs ; epoch ++ ) { Collections . shuffle ( randomOrder ) ; for ( int i : randomOrder ) toTrain . update ( dataSet . getDataPoint ( i ) , dataSet . getDataPointCategory ( i ) ) ; } }
performs training on an updateable classifier by going over the whole data set in random order one observation at a time , multiple times .
