// Collect MinMax stats for feature normalization
FeatureSelection<String> featureSelection = EventAnnotator.createFeatureSelection(this.featureSelectionThreshold);
featureSelection.train(instances);
featureSelection.save(EventAnnotator.createFeatureSelectionURI(directory));
// now write in the libsvm format
LIBLINEARStringOutcomeDataWriter dataWriter = new LIBLINEARStringOutcomeDataWriter(directory);
for (Instance<String> instance : instances) {
dataWriter.write(featureSelection.transform(instance));
}
dataWriter.finish();
}
JarClassifierBuilder.trainAndPackage(directory, "-c", "0.05");
}