{
questionNumber.addAndGet(1);
return new Pair<Integer,String>(graph.paths.tracePathPrefixClosed(question),null);
}
};
QuestionAndRestartCounter l = new QuestionAndRestartCounter(learner);
sPlus = rpg.getExtraSequences(percent/10-1);sMinus = rpg.getAllSequences(percent/10-1);
LearnerGraph learnt = learn(l,sMinus);
PTA_computePrecisionRecall precRec = new PTA_computePrecisionRecall(learnt);
PTASequenceEngine engine = new PTA_FSMStructure(graph,null);
precRec.crossWith(sMinus);PosNegPrecisionRecall ptaPR = precRec.getPosNegPrecisionRecallNum();
SequenceSet ptaTestSet = engine.new SequenceSet();ptaTestSet.setIdentity();
ptaTestSet = ptaTestSet.cross(graph.wmethod.getFullTestSet(1));
precRec.crossWith(engine);PosNegPrecisionRecall prNeg = precRec.getPosNegPrecisionRecallNum();
assert questionNumber.get() == l.getQuestionCounter();
// Column 0 is the name of the learner.
// Columns 3 and 4
result = result+prNeg.getPrecision()+FS+prNeg.getRecall();
result = result + FS + questionNumber+ FS + // 5
// Columns 6 and 7
ptaPR.getPrecision() + FS + ptaPR.getRecall() + FS +
"size:"+size+FS+ // 8
"chunks: "+(100/percentPerChunk)+FS+ // 9
"per chunk:"+nrPerChunk + // 10
FS+percent+"%"+FS+ // 11
"+:"+sPlus.getData().size()+FS+// 12
"-:"+sMinus.getData(PTASequenceEngine.truePred).size(); // 13
try
{
result = result + FS+"L"+// 14
// 15 and 16
FS+Linear.getSimilarity(graph,learnt, false, 1)+FS+Linear.getSimilarity(graph, learnt, true, 1);
// 17
result = result + FS + Linear.getSimilarityGD(graph,learnt, 1).getCompressionRate();// + graph.linear.getSimilarityWithNegatives(learned, 1, GDLearnerGraph.DDRH_default.class);
// 18
result = result + FS + Linear.getSimilarityGD_details(graph,learnt, 1);// + graph.linear.getSimilarityWithNegatives(learned, 1, GDLearnerGraph.DDRH_default.class);
}
catch(IllegalArgumentException ex)
{
StringWriter wr = new StringWriter();ex.printStackTrace(new PrintWriter(wr));
result = result+"\n"+"exception from linear: "+ex+
" on graph with "+learnt.getStateNumber()+" and "+learnt.getStateNumber()+" transitions" +
"\n"+wr.getBuffer().toString();
}
// 19 and 20
result = result + FS + graph.paths.getExtentOfCompleteness() + FS + learnt.paths.getExtentOfCompleteness() + FS +
l.getRestarts(); // 21
}