Package org.data2semantics.proppred.kernels.rdfgraphkernels

Examples of org.data2semantics.proppred.kernels.rdfgraphkernels.RDFIntersectionPartialSubTreeKernel



    inference = false;
    for (int i = 1; i <= depth; i++) {
      resTable.newRow("IPST, no inference, depth=" + i);
      KernelExperiment<RDFGraphKernel> exp = new RDFOldKernelExperiment(new RDFIntersectionPartialSubTreeKernel(i, 0.01, inference, true, blankLabels), seeds, parms, dataset, instances, labels, blackList);

      System.out.println("Running IPST: " + i + " ");
      exp.run();

      for (Result res : exp.getResults()) {
        resTable.addResult(res);
      }
    }
    saveResults(resTable, "affiliation.ser");

    inference = true;
    for (int i = 1; i <= depth; i++) {
      resTable.newRow("IPST, inference, depth=" + i);
      KernelExperiment<RDFGraphKernel> exp = new RDFOldKernelExperiment(new RDFIntersectionPartialSubTreeKernel(i, 0.01, inference, true, blankLabels), seeds, parms, dataset, instances, labels, blackList);

      System.out.println("Running IPST: " + i + " ");
      exp.run();

      for (Result res : exp.getResults()) {
View Full Code Here


      List<List<Result>> res = new ArrayList<List<Result>>();
      for (long seed : seeds) {
        long[] s2 = new long[1];
        s2[0] = seed;
        createGeoDataSet(seed, fraction,  minSize, "http://data.bgs.ac.uk/ref/Lexicon/hasTheme");
        KernelExperiment<RDFGraphKernel> exp = new RDFOldKernelExperiment(new RDFIntersectionPartialSubTreeKernel(i, 0.01, inference, true, false), s2, parms, dataset, instances, labels, blackList);
        res.add(exp.getResults());

        System.out.println("Running IPST: " + i);
        if (experimenter.hasSpace()) {
          experimenter.addExperiment(exp);
        }
      }

      experimenter.stop();

      while (expT.isAlive()) {
        try {
          Thread.sleep(1000);
        } catch (Exception e) {
          e.printStackTrace();
        }
      }

      for (Result res2 : Result.mergeResultLists(res)) {
        resTable.addResult(res2);
      }
    }
    saveResults(resTable, "geo_theme.ser");



    inference = true;
    for (int i = 1; i <= depth; i++) {
      resTable.newRow("IPST, inference, depth="+i);

      Experimenter experimenter = new Experimenter(2);
      Thread expT = new Thread(experimenter);
      expT.setDaemon(true);
      expT.start();

      List<List<Result>> res = new ArrayList<List<Result>>();
      for (long seed : seeds) {
        long[] s2 = new long[1];
        s2[0] = seed;
        createGeoDataSet(seed, fraction,  minSize, "http://data.bgs.ac.uk/ref/Lexicon/hasTheme");
        KernelExperiment<RDFGraphKernel> exp = new RDFOldKernelExperiment(new RDFIntersectionPartialSubTreeKernel(i, 0.01, inference, true, false), s2, parms, dataset, instances, labels, blackList);
        res.add(exp.getResults());

        System.out.println("Running IPST: " + i);
        if (experimenter.hasSpace()) {
          experimenter.addExperiment(exp);
View Full Code Here


    inference = false;
    for (int i = 1; i <= depth; i++) {
      resTable.newRow("IPST, no inference, depth="+i);
      KernelExperiment<RDFGraphKernel> exp = new RDFOldKernelExperiment(new RDFIntersectionPartialSubTreeKernel(i, 0.01, inference, true, blankLabels), seeds, parms, dataset, instances, labels, blackList);

      System.out.println("Running IPST: " + i + " ");
      exp.run();

      for (Result res : exp.getResults()) {
        resTable.addResult(res);
      }
    }
    saveResults(resTable, "geo_litho.ser");

    inference = true;
    for (int i = 1; i <= depth; i++) {
      resTable.newRow("IPST, inference, depth="+i);
      KernelExperiment<RDFGraphKernel> exp = new RDFOldKernelExperiment(new RDFIntersectionPartialSubTreeKernel(i, 0.01, inference, true, blankLabels), seeds, parms, dataset, instances, labels, blackList);

      System.out.println("Running IPST: " + i + " ");
      exp.run();

      for (Result res : exp.getResults()) {
View Full Code Here

    // In this case this is the affiliation triple and the reverse relation triple, which is the employs relation.
    for (Resource instance : instances) {
      blackList.addAll(dataset.getStatementsFromStrings(instance.toString(), "http://swrc.ontoware.org/ontology#affiliation", null));
      blackList.addAll(dataset.getStatementsFromStrings(null, "http://swrc.ontoware.org/ontology#employs", instance.toString()));
    }
    RDFIntersectionPartialSubTreeKernel kernel = new RDFIntersectionPartialSubTreeKernel();
    double[][] matrix = kernel.compute(dataset, instances, blackList);
   
    for (int i = 0; i < matrix.length; i++) {
      System.out.println(Arrays.toString(matrix[i]));
    }
  }
View Full Code Here

TOP

Related Classes of org.data2semantics.proppred.kernels.rdfgraphkernels.RDFIntersectionPartialSubTreeKernel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.