/** * @param filePath * the xmi file or directory path of the dataset * @return return the instances of the dataset, represented in * <code>Event</code>s */ protected final EventStream readInXmiFiles(String filePath) throws ConfigurationException { List<Event> eventList = new ArrayList<Event>(); File dir = new File(filePath); if (dir.isFile()) { eventList.add(readInXmiFile(dir.getAbsolutePath())); } else if (dir.isDirectory()) { for (File file : dir.listFiles()) { // ignore all the non-xmi files if (!file.getName().endsWith(".xmi")) { continue; } // add the instance to the dataset eventList.add(readInXmiFile(file.getAbsolutePath())); } } return new ListEventStream(eventList); }
private void train() throws Exception { this.model = GIS.trainModel(new ListEventStream(this.dataSet .getInstances()), 100, 0); }
private void train() throws Exception { this.model = GIS.trainModel(new ListEventStream(this.dataSet .getInstances()), 100, 0); }