/** * Writes the table into the writer, in a CSV style. */ public void print() { for (K col : table.allCols()) { writer.print(","); writer.print(col.toString()); } writer.println(); for (K row : table.allRows()) { writer.print(row.toString()); for (K col : table.colsOfRow(row)) { writer.print(","); V v = table.get(row,col); writer.print(v.toString()); } writer.println(); } }
protected void process(WithStatisticsTextTreesProcessor processor, String processorDescription) throws TeEngineMlException, OperationException, ClassifierException, ScriptException, RuleBaseException, TreeAndParentMapException, AnnotatorException { processImpl(processor, processorDescription); String id = this.pairData.getPair().getId().toString(); expandedTable.put(id, processorDescription, processor.getNumberOfExpandedElements()); generatedeTable.put(id, processorDescription, processor.getNumberOfGeneratedElements()); }
protected void processImpl(TextTreesProcessor processor, String processorDescription) throws TeEngineMlException, OperationException, ClassifierException, ScriptException, RuleBaseException, TreeAndParentMapException, AnnotatorException { setTaskNameInTextTreesProcessor(processor); long startNano = getCurrentCpuTime(); processor.process(); long endNano = getCurrentCpuTime(); long elapsed = endNano-startNano; String id = this.pairData.getPair().getId().toString(); timeTable.put(id, processorDescription, elapsed); Map<Integer, Double> featureVector = processor.getBestTree().getFeatureVector(); double cost = -this.classifier.getProduct(featureVector); costTable.put(id, processorDescription,cost); logSummary(processor, processorDescription, cost); }