String outcome = "E";
if(isChem.get(s)) outcome = "C";
events.add(new Event(outcome, getFeatures(s)));
}
SimpleEventCollector sec = new SimpleEventCollector(events);
DataIndexer di = new TwoPassDataIndexer(new EventCollectorAsStream(sec), 1);
GISModel gis = GIS.trainModel(100, di);
System.out.println(gis.getIndex("FOO"));
if(true) return;
long time = System.currentTimeMillis();
StringGISModelWriter sgmw = new StringGISModelWriter(gis);
sgmw.persist();
String modelStr = sgmw.toString();
//System.out.println(modelStr);
StringGISModelReader sgmr = new StringGISModelReader(modelStr);
gis = sgmr.getModel();
System.out.println("Round trip in " + (System.currentTimeMillis() - time));
System.out.println(modelStr.length());
//if(true) return;
GISModel gis2 = null;
if(false) {
List<Event> events2 = new ArrayList<Event>();
for(String s : batch2) {
double prob = gis.eval(getFeatures(s))[gis.getIndex("C")];
String outcome = "E";
if(isChem.get(s)) outcome = "C";
events.add(new Event(outcome, probToFeatures(prob)));
}
sec = new SimpleEventCollector(events);
di = new TwoPassDataIndexer(new EventCollectorAsStream(sec), 2);
gis2 = GIS.trainModel(1000, di);
}
double score = 0.0;
List<Double> trialScores = new ArrayList<Double>();