int[] shuff_withClass = new int[filt_learn.numAttributes()];
for (int jj = 0; jj < filt_learn.numAttributes()-1; jj++) {shuff_noClass[jj]=String.valueOf(jj);}
Collections.shuffle(Arrays.asList(shuff_noClass), new Random(42));
for (int kk = 0; kk < filt_learn.numAttributes()-1; kk++) {shuff_withClass[kk]=Integer.valueOf(shuff_noClass[kk]);}
shuff_withClass[filt_learn.numAttributes()-1] = filt_learn.numAttributes()-1;
Reorder reo = new Reorder();
reo.setAttributeIndicesArray(shuff_withClass);
Instances shuffled_learn = new Instances(filt_learn);
reo.setInputFormat(shuffled_learn);
shuffled_learn = Filter.useFilter(shuffled_learn, reo);
Instances shuffled_hold = new Instances(filt_hold);
reo.setInputFormat(shuffled_hold);
shuffled_hold = Filter.useFilter(shuffled_hold, reo);
///////////Randomizes the order of the instances (Doesn't matter here, because we're using the whole set!)
Instances randData = new Instances(shuffled_learn);
cpyCls[0].buildClassifier(randData);
///// Figure out who stays and who goes ////////////
WinningShuffle_Learn = shuffled_learn;
WinningShuffle_Hold = shuffled_hold;
}
for (int PII_iter_count = 0; PII_iter_count < numIters; PII_iter_count++){
//Randomize the ORDER of the ATTRIBUTES (not the instances, because that would be stupid//
String[] shuff_noClass = new String[filt_learn.numAttributes()-1];
int[] shuff_withClass = new int[filt_learn.numAttributes()];
for (int jj = 0; jj < filt_learn.numAttributes()-1; jj++) {shuff_noClass[jj]=String.valueOf(jj);}
if (PII_iter_count!=0){Collections.shuffle(Arrays.asList(shuff_noClass), new Random(PII_iter_count+1));}
for (int kk = 0; kk < filt_learn.numAttributes()-1; kk++) {shuff_withClass[kk]=Integer.valueOf(shuff_noClass[kk]);}
shuff_withClass[filt_learn.numAttributes()-1] = filt_learn.numAttributes()-1;
Reorder reo = new Reorder();
reo.setAttributeIndicesArray(shuff_withClass);
Instances shuffled_learn = new Instances(filt_learn);
reo.setInputFormat(shuffled_learn);
shuffled_learn = Filter.useFilter(shuffled_learn, reo);
Instances shuffled_hold = new Instances(filt_hold);
reo.setInputFormat(shuffled_hold);
shuffled_hold = Filter.useFilter(shuffled_hold, reo);
///////////Randomizes the order of the instances (Doesn't matter here, because we're using the whole set!)
Instances randData = new Instances(shuffled_learn);