// now write in the libsvm format
// LIBLINEARStringOutcomeDataWriter dataWriter = new LIBLINEARStringOutcomeDataWriter(directory);
Constructor c = this.dataWriterClass.getConstructor(File.class);
DataWriter dataWriter = (DataWriter) c.newInstance(directory);
// try filtering
for (Instance<String> instance : instances) {
dataWriter.write(featureSelection.transform(instance));
}
dataWriter.finish();
}
// train models based on instances
JarClassifierBuilder.trainAndPackage(directory, "-c", "0.05");
}