/** This method is executed on an executor thread. */
@Override
public void runTheExperiment()
{
int size = 2*graph.pathroutines.countEdges();
RandomPathGenerator rpg = new RandomPathGenerator(graph, new Random(100),5,null);// the seed for Random should be the same for each file
int percentPerChunk = 10;
int nrPerChunk = size/(100/percentPerChunk);nrPerChunk+=nrPerChunk % 2;// make the number even
rpg.generatePosNeg(2*nrPerChunk , 100/percentPerChunk);// 2* reflects the fact that nrPerChunk denotes the number of elements in both chunks (positive and negative) combined. */
LearnerEvaluationConfiguration evaluationConfiguration = new LearnerEvaluationConfiguration(null,null,config,null,null);
evaluationConfiguration.setLabelConverter(experiment.getLabelConverter());
RPNILearner learner = new RPNIUniversalLearner(null,evaluationConfiguration)
{
@Override
public Pair<Integer,String> CheckWithEndUser(
@SuppressWarnings("unused") LearnerGraph model,
List<Label> question, @SuppressWarnings("unused") int valueForNoRestart,
@SuppressWarnings("unused") List<Boolean> acceptedElements,
@SuppressWarnings("unused") PairScore pairBeingMerged,
@SuppressWarnings("unused") final Object [] moreOptions)
{
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();