String largeValues = "predA=10 predB=20 A\n" + "predB=30 predA=10 B\n";
String largeTest = "predA=20 predB=20";
StringReader smallReader = new StringReader(smallValues);
EventStream smallEventStream = new RealBasicEventStream(
new PlainTextByLineDataStream(smallReader));
MaxentModel smallModel = GIS.trainModel(100,
new OnePassRealValueDataIndexer(smallEventStream, 0), false);
String[] contexts = smallTest.split(" ");
float[] values = RealValueFileEventStream.parseContexts(contexts);
double[] smallResults = smallModel.eval(contexts, values);
String smallResultString = smallModel.getAllOutcomes(smallResults);
System.out.println("smallResults: " + smallResultString);
StringReader largeReader = new StringReader(largeValues);
EventStream largeEventStream = new RealBasicEventStream(
new PlainTextByLineDataStream(largeReader));
MaxentModel largeModel = GIS.trainModel(100,
new OnePassRealValueDataIndexer(largeEventStream, 0), false);
contexts = largeTest.split(" ");