dataSetsParams.add(new LinkPredictionDataSetParameters(testSetB, "http://swrc.ontoware.org/ontology#Person", "http://swrc.ontoware.org/ontology#ResearchGroup", "http://swrc.ontoware.org/ontology#affiliation", bl, 2, true, false));
dataSetsParams.add(new LinkPredictionDataSetParameters(testSetB, "http://swrc.ontoware.org/ontology#Person", "http://swrc.ontoware.org/ontology#ResearchGroup", "http://swrc.ontoware.org/ontology#affiliation", bl, 1, true, true));
dataSetsParams.add(new LinkPredictionDataSetParameters(testSetB, "http://swrc.ontoware.org/ontology#Person", "http://swrc.ontoware.org/ontology#ResearchGroup", "http://swrc.ontoware.org/ontology#affiliation", bl, 2, true, true));
*/
LinkPredictionDataSet dataset;
LinkPredictionExperiment exp;
ResultsTable resultsWL = new ResultsTable();
ResultsTable resultsSTF = new ResultsTable();
ResultsTable resultsSTP = new ResultsTable();
ResultsTable resultsIGW = new ResultsTable();
ResultsTable resultsIGP = new ResultsTable();
Experimenter experimenter = new Experimenter(NUMBER_OF_PROC);
Thread expT = new Thread(experimenter);
expT.setDaemon(true);
expT.start();
try {
for (LinkPredictionDataSetParameters params : dataSetsParams) {
dataset = DataSetFactory.createLinkPredictonDataSet(params);
//dataset.removeSmallClasses(5);
resultsWL.newRow(dataset.getLabel() + " WLSubTreeKernel");
for (int i = 0; i < 3; i++) {
if (experimenter.hasSpace()) {
int fileId = (int) (Math.random() * 100000000);
File file = new File(DATA_DIR + "_" + "WL" + fileId + "_" + i + ".txt");
exp = new LinkPredictionExperiment(new LinkPredictionDataSet(dataset), new WLSubTreeKernel(i), new WLSubTreeKernel(i), 3.0/6.0, 3.0/6.0, seeds, cs, maxClassSize, new FileOutputStream(file));
experimenter.addExperiment(exp);
resultsWL.addResult(exp.getResults().getAccuracy());
resultsWL.addResult(exp.getResults().getF1());
resultsWL.addResult(exp.getResults().getrPrecision());
resultsWL.addResult(exp.getResults().getAveragePrecision());
resultsWL.addResult(exp.getResults().getNdcg());
System.out.println("Running WL, it " + i + " on " + dataset.getLabel());
}
}
resultsSTF.newRow(dataset.getLabel() + " IntersectionFullSubTreeKernel");
for (int i = 0; i < 3; i++) {
if (experimenter.hasSpace()) {
int fileId = (int) (Math.random() * 100000000);
File file = new File(DATA_DIR + "_" + "IntersectionFullSubTree" + fileId + "_" + i + ".txt");
exp = new LinkPredictionExperiment(new LinkPredictionDataSet(dataset), new IntersectionSubTreeKernel(i,1), new IntersectionSubTreeKernel(i,1), 3.0/6.0, 3.0/6.0, seeds, cs, maxClassSize, new FileOutputStream(file));
experimenter.addExperiment(exp);
resultsSTF.addResult(exp.getResults().getAccuracy());
resultsSTF.addResult(exp.getResults().getF1());
resultsSTF.addResult(exp.getResults().getrPrecision());
resultsSTF.addResult(exp.getResults().getAveragePrecision());
resultsSTF.addResult(exp.getResults().getNdcg());
System.out.println("Running STF, it " + i + " on " + dataset.getLabel());
}
}
resultsSTP.newRow(dataset.getLabel() + " IntersectionPartialSubTreeKernel");
for (int i = 0; i < 3; i++) {
if (experimenter.hasSpace()) {
int fileId = (int) (Math.random() * 100000000);
File file = new File(DATA_DIR + "_" + "IntersectionPartialSubTree" + fileId + "_" + i + ".txt");
exp = new LinkPredictionExperiment(new LinkPredictionDataSet(dataset), new IntersectionPartialSubTreeKernel(i,0.01), new IntersectionPartialSubTreeKernel(i,0.01), 3.0/6.0, 3.0/6.0, seeds, cs, maxClassSize, new FileOutputStream(file));
experimenter.addExperiment(exp);
resultsSTP.addResult(exp.getResults().getAccuracy());
resultsSTP.addResult(exp.getResults().getF1());
resultsSTP.addResult(exp.getResults().getrPrecision());
resultsSTP.addResult(exp.getResults().getAveragePrecision());
resultsSTP.addResult(exp.getResults().getNdcg());
System.out.println("Running STP, it " + i + " on " + dataset.getLabel());
}
}
/*