int numFeats = 5;
double randomFrac = 0.5;
double missingFrac = 0.5;
for (int instInd = 0; instInd < 10; instInd++) {
String label = classes[r.nextInt(classes.length)];
SparseVector sv = new SparseVector();
for (int fInd = 0; fInd < numFeats; fInd++) {
if (r.nextDouble() < missingFrac)
continue;
String tmpLab = label;
if (r.nextDouble() < randomFrac)
tmpLab = classes[r.nextInt(classes.length)];
sv.add(xAlphabet.lookupObject(tmpLab + fInd), 1);
}
train.add(new ClassificationInstance(xAlphabet, yAlphabet, sv,
label));
}
AdaBoost boost = new AdaBoost(10, xAlphabet, yAlphabet,