weights[(int) label - 1] = 1 / counts.get(label);
}
linParms.setWeightLabels(wLabels);
linParms.setWeights(weights);
RDFLinearKernelExperiment exp = new RDFLinearKernelExperiment(new RDFWLSubTreeKernel(it, i, inference, true), seeds2, linParms, dataset, instances, target, blackList, evalFuncs);
System.out.println("Running WL RDF: " + i + " " + it);
exp.setDoCV(true);
exp.run();
res.add(exp.getResults());
}
for (Result res2 : Result.mergeResultLists(res)) {
resTable.addResult(res2);
}
}
}
System.out.println(resTable);
for (int i : depths) {
resTable.newRow("WL RDF BoW, depth="+i);
for (int it : iterations) {
List<List<Result>> res = new ArrayList<List<Result>>();
for (long seed : seeds) {
long[] seeds2 = {seed};
createGeoDataSet((int)(1000 * fraction), fraction, seed, "http://data.bgs.ac.uk/ref/Lexicon/hasTheme");
List<Double> target = EvaluationUtils.createTarget(labels);
LibLINEARParameters linParms = new LibLINEARParameters(LibLINEARParameters.SVC_DUAL, cs);
linParms.setDoCrossValidation(true);
linParms.setNumFolds(5);
Map<Double, Double> counts = EvaluationUtils.computeClassCounts(target);
int[] wLabels = new int[counts.size()];
double[] weights = new double[counts.size()];
for (double label : counts.keySet()) {
wLabels[(int) label - 1] = (int) label;
weights[(int) label - 1] = 1 / counts.get(label);
}
linParms.setWeightLabels(wLabels);
linParms.setWeights(weights);
RDFLinearKernelExperiment exp = new RDFLinearKernelExperiment(new RDFWLSubTreeWithTextKernel(it, i, inference, true), seeds2, linParms, dataset, instances, target, blackList, evalFuncs);
System.out.println("Running WL RDF with text: " + i + " " + it);
exp.setDoCV(true);
exp.run();
res.add(exp.getResults());
}
for (Result res2 : Result.mergeResultLists(res)) {
resTable.addResult(res2);
}
}
}
System.out.println(resTable);
for (int i : depths) {
resTable.newRow("ITP, depth="+i);
List<List<Result>> res = new ArrayList<List<Result>>();
for (long seed : seeds) {
long[] seeds2 = {seed};
createGeoDataSet((int)(1000 * fraction), fraction, seed, "http://data.bgs.ac.uk/ref/Lexicon/hasTheme");
List<Double> target = EvaluationUtils.createTarget(labels);
LibLINEARParameters linParms = new LibLINEARParameters(LibLINEARParameters.SVC_DUAL, cs);
linParms.setDoCrossValidation(true);
linParms.setNumFolds(5);
Map<Double, Double> counts = EvaluationUtils.computeClassCounts(target);
int[] wLabels = new int[counts.size()];
double[] weights = new double[counts.size()];
for (double label : counts.keySet()) {
wLabels[(int) label - 1] = (int) label;
weights[(int) label - 1] = 1 / counts.get(label);
}
linParms.setWeightLabels(wLabels);
linParms.setWeights(weights);
RDFLinearKernelExperiment exp = new RDFLinearKernelExperiment(new RDFIntersectionTreeEdgeVertexPathKernel(i, false, inference, true), seeds2, linParms, dataset, instances, target, blackList, evalFuncs);
System.out.println("Running EVP: " + i);
exp.setDoCV(true);
exp.run();
res.add(exp.getResults());
}
for (Result res2 : Result.mergeResultLists(res)) {
resTable.addResult(res2);
}
}
System.out.println(resTable);
for (int i : depths) {
resTable.newRow("ITP BoW, depth="+i);
List<List<Result>> res = new ArrayList<List<Result>>();
for (long seed : seeds) {
long[] seeds2 = {seed};
createGeoDataSet((int)(1000 * fraction), fraction, seed, "http://data.bgs.ac.uk/ref/Lexicon/hasTheme");
List<Double> target = EvaluationUtils.createTarget(labels);
LibLINEARParameters linParms = new LibLINEARParameters(LibLINEARParameters.SVC_DUAL, cs);
linParms.setDoCrossValidation(true);
linParms.setNumFolds(5);
Map<Double, Double> counts = EvaluationUtils.computeClassCounts(target);
int[] wLabels = new int[counts.size()];
double[] weights = new double[counts.size()];
for (double label : counts.keySet()) {
wLabels[(int) label - 1] = (int) label;
weights[(int) label - 1] = 1 / counts.get(label);
}
linParms.setWeightLabels(wLabels);
linParms.setWeights(weights);
RDFLinearKernelExperiment exp = new RDFLinearKernelExperiment(new RDFIntersectionTreeEdgeVertexPathWithTextKernel(i, false, inference, false), seeds2, linParms, dataset, instances, target, blackList, evalFuncs);
System.out.println("Running EVP with text: " + i);
exp.setDoCV(true);
exp.setDoTFIDF(true);
exp.run();
res.add(exp.getResults());
}
for (Result res2 : Result.mergeResultLists(res)) {
resTable.addResult(res2);
}
}
System.out.println(resTable);
for (int i : depths) {
resTable.newRow("IST, depth="+i);
List<List<Result>> res = new ArrayList<List<Result>>();
for (long seed : seeds) {
long[] seeds2 = {seed};
createGeoDataSet((int)(1000 * fraction), fraction, seed, "http://data.bgs.ac.uk/ref/Lexicon/hasTheme");
List<Double> target = EvaluationUtils.createTarget(labels);
LibSVMParameters svmParms = new LibSVMParameters(LibSVMParameters.C_SVC, cs);
svmParms.setNumFolds(5);
KernelExperiment<RDFGraphKernel> exp = new RDFOldKernelExperiment(new RDFIntersectionSubTreeKernel(i, 1, inference, true), seeds2, svmParms, dataset, instances, labels, blackList);
System.out.println("Running IST: " + i);
exp.run();
res.add(exp.getResults());
}
for (Result res2 : Result.mergeResultLists(res)) {
resTable.addResult(res2);
}