/* Create a binary attribute */
FastVector binary_values = new FastVector(2);
binary_values.addElement("otherClasses");
binary_values.addElement("defClass");
Attribute attr = new Attribute ("newClass", binary_values);
data.insertAttributeAt(attr, index);
data.setClassIndex(index); // The new class label
/* Partition the data into bags according to their original class values */
Instances[] dataByClass = new Instances[numCl];
for(int i=0; i < numCl; i++)