protected EventStream getFileEventStream(File file) throws IOException { return new FileEventStream(file); }
protected String toLine(Event ev) { return FileEventStream.toLine(ev); } }
/** * Trains and writes a model based on the events in the specified event file. * the name of the model created is based on the event file name. * @param args eventfile [iterations cuttoff] * @throws IOException when the eventfile can not be read or the model file can not be written. */ public static void main(String[] args) throws IOException { if (args.length == 0) { System.err.println("Usage: FileEventStream eventfile [iterations cutoff]"); System.exit(1); } int ai=0; String eventFile = args[ai++]; int iterations = 100; int cutoff = 5; if (ai < args.length) { iterations = Integer.parseInt(args[ai++]); cutoff = Integer.parseInt(args[ai++]); } AbstractModel model; FileEventStream es = new FileEventStream(eventFile); try { model = GIS.trainModel(es,iterations,cutoff); } finally { es.close(); } new SuffixSensitiveGISModelWriter(model, new File(eventFile+".bin.gz")).persist(); } }
/** * Trains and writes a model based on the events in the specified event file. * the name of the model created is based on the event file name. * @param args eventfile [iterations cuttoff] * @throws IOException when the eventfile can not be read or the model file can not be written. */ public static void main(String[] args) throws IOException { if (args.length == 0) { System.err.println("Usage: FileEventStream eventfile [iterations cutoff]"); System.exit(1); } int ai=0; String eventFile = args[ai++]; int iterations = 100; int cutoff = 5; if (ai < args.length) { iterations = Integer.parseInt(args[ai++]); cutoff = Integer.parseInt(args[ai++]); } AbstractModel model; FileEventStream es = new FileEventStream(eventFile); try { model = GIS.trainModel(es,iterations,cutoff); } finally { es.close(); } new SuffixSensitiveGISModelWriter(model, new File(eventFile+".bin.gz")).persist(); } }
FileEventStream fes = new FileEventStream(tmp); try { eventsToCompare = index(numEvents, fes, predicateIndex); } finally { fes.close();
Event ev = eventStream.next(); eventCount++; eventStore.write(FileEventStream.toLine(ev)); String[] ec = ev.getContext(); update(ec,predicateSet,counter,cutoff);
/** * Trains and writes a model based on the events in the specified event file. * the name of the model created is based on the event file name. * * @param args * eventfile [iterations cuttoff] * @throws IOException * when the eventfile can not be read or the model file can not be * written. */ public static void main(String[] args) throws IOException { if (args.length == 0) { LOG.error("Usage: FileEventStream eventfile [iterations cutoff]"); System.exit(1); } int ai = 0; String eventFile = args[ai++]; EventStream es = new FileEventStream(eventFile); int iterations = 100; int cutoff = 5; if (ai < args.length) { iterations = Integer.parseInt(args[ai++]); cutoff = Integer.parseInt(args[ai++]); } AbstractModel model = GIS.trainModel(es, iterations, cutoff); new SuffixSensitiveGISModelWriter(model, new File(eventFile + ".bin.gz")).persist(); } }
FileEventStream fes = new FileEventStream(tmp); try { eventsToCompare = index(numEvents, fes, predicateIndex); } finally { fes.close();
Event ev = eventStream.next(); eventCount++; eventStore.write(FileEventStream.toLine(ev)); String[] ec = ev.getContext(); update(ec,predicateSet,counter,cutoff);