///*
//List<DTNode<String,String>> newIN = new ArrayList<DTNode<String,String>>(instanceNodes3);
//DTGraph<String,String> newG = GraphUtils.simplifyGraph(graph3, GraphUtils.createHubMap(hubList, th), newIN, false, true);
//System.out.println("New #links: "+ newG.numLinks() + ", old #links: " + graph3.numLinks());
exp = new MoleculeGraphExperiment<DTGraph<String,String>>(new WLSubTreeKernel(it, true, forward),
seeds, svmParms, GraphUtils.getSubGraphs(newGs.get(0), newIN.get(0), depth), target, evalFuncs);
System.out.println("running, remove hubs, th: " + th);
exp.run();
for (Result res : exp.getResults()) {
resTable.addResult(res);
}
//newIN = new ArrayList<DTNode<String,String>>(instanceNodes3);
//newG = GraphUtils.simplifyGraph(graph3, GraphUtils.createHubMap(hubList, th), newIN, true, false);
//System.out.println("New #links: "+ newG.numLinks() + ", old #links: " + graph3.numLinks());
exp = new MoleculeGraphExperiment<DTGraph<String,String>>(new WLSubTreeKernel(it, true, forward),
seeds, svmParms, GraphUtils.getSubGraphs(newGs.get(1), newIN.get(1), depth), target, evalFuncs);
System.out.println("running, relabel hubs, th: " + th);
exp.run();
for (Result res : exp.getResults()) {
resTable.addResult(res);
}
//newIN = new ArrayList<DTNode<String,String>>(instanceNodes3);
//newG = GraphUtils.simplifyGraph(graph3, GraphUtils.createHubMap(hubList, th), newIN, true, true);
//System.out.println("New #links: "+ newG.numLinks() + ", old #links: " + graph3.numLinks());
exp = new MoleculeGraphExperiment<DTGraph<String,String>>(new WLSubTreeKernel(it, true, forward),
seeds, svmParms, GraphUtils.getSubGraphs(newGs.get(2), newIN.get(2), depth), target, evalFuncs);
System.out.println("running, relabel+remove hubs, th: " + th);
exp.run();
for (Result res : exp.getResults()) {
resTable.addResult(res);
}
//*/
}
System.out.println(resTable);
}
resTable.addCompResults(resTable.getBestResults());
System.out.println(resTable);
System.out.println(resTable.allScoresToString());
saveResults(resTable.toString(), "results_simp_" + System.currentTimeMillis() + ".txt");
saveResults(resTable.allScoresToString(), "results_full_simp_" + System.currentTimeMillis() + ".txt");
/*
* INSTANCE EXTRACTION!!!!! ah yeah ;)
*
*/
// Discover average size
List<DTGraph<String,String>> sg = GraphUtils.getSubGraphs(graph3, new ArrayList<DTNode<String,String>>(instanceNodes3), 3);
double avg = 0;
for (DTGraph<String,String> sgp : sg) {
avg += sgp.size();
}
avg /= sg.size();
System.out.println("Average Number of nodes: " + avg);
// Results Table
ResultsTable resTable2 = new ResultsTable();
resTable2.setDigits(3);
double[] fracs = {0.25, 0.5, 0.75, 1.0, 1.5, 2.0};
for (double frac : fracs) {
resTable2.newRow("Fraction: " + frac);
List<DTGraph<String,String>> ihDepth = InstanceHelper.getInstances(graph4, instanceNodes4, target, InstanceHelper.Method.DEPTH, (int) Math.round(frac*avg), 4, true);
exp = new MoleculeGraphExperiment<DTGraph<String,String>>(new WLSubTreeKernel(it, true, forward), seeds, svmParms, ihDepth, target, evalFuncs);
System.out.println("running, Depth: " + frac);
exp.run();
for (Result res : exp.getResults()) {
resTable2.addResult(res);
}
List<DTGraph<String,String>> ihUnInformed = InstanceHelper.getInstances(graph4, instanceNodes4, target, InstanceHelper.Method.UNINFORMED, (int) Math.round(frac*avg), 4, true);
exp = new MoleculeGraphExperiment<DTGraph<String,String>>(new WLSubTreeKernel(it, true, forward), seeds, svmParms, ihUnInformed, target, evalFuncs);
System.out.println("running, UnInformed: " + frac);
exp.run();
for (Result res : exp.getResults()) {
resTable2.addResult(res);
}
List<DTGraph<String,String>> ihInformed = InstanceHelper.getInstances(graph4, instanceNodes4, target, InstanceHelper.Method.INFORMED, (int) Math.round(frac*avg), 4, true);
exp = new MoleculeGraphExperiment<DTGraph<String,String>>(new WLSubTreeKernel(it, true, forward), seeds, svmParms, ihInformed, target, evalFuncs);
System.out.println("running, Informed: " + frac);
exp.run();
for (Result res : exp.getResults()) {