Package org.data2semantics.proppred.learners.libsvm

Examples of org.data2semantics.proppred.learners.libsvm.LibSVMParameters


     
      Map<String, Integer> labelMap = new TreeMap<String, Integer>();
      labelMap.put("true", -1);
      labelMap.put("false", 1);
     
      LibSVMParameters param = new LibSVMParameters(LibSVMParameters.NU_SVC, cs);
      //param.setVerbose(true);
      int[] weightLabels = {-1, 1};
      double[] weights = {1,1};
      param.setWeightLabels(weightLabels);
      param.setWeights(weights);
       
      LibSVMModel model = LibSVM.trainSVMModel(matrix, LibSVM.createTargets(labels, labelMap), param);
     
      double[][] testMatrix = combineTestKernels(testMatrixA, testMatrixB);
      //double[][] testMatrix = matrix; 
View Full Code Here


        subset.shuffle(seeds[i]);
        matrix = kernel.compute(subset.getGraphs());
        target = LibSVM.createTargets(subset.getLabels());
      }     
       
      LibSVMParameters params = new LibSVMParameters(LibSVMParameters.C_SVC, cs);
      double[] prediction = LibSVM.extractLabels(LibSVM.crossValidate(matrix, target, params, 10));
     
      accScores[i] = LibSVM.computeAccuracy(target, prediction);
      fScores[i]   = LibSVM.computeF1(target, prediction);   
    }
View Full Code Here

      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);
View Full Code Here

      weights[(int) label - 1] = 1 / counts.get(label);
    }
    linParms.setWeightLabels(wLabels);
    linParms.setWeights(weights);

    LibSVMParameters svmParms = new LibSVMParameters(LibSVMParameters.C_SVC, cs);
    svmParms.setNumFolds(10);

    svmParms.setWeightLabels(EvaluationUtils.computeWeightLabels(target));
    svmParms.setWeights(EvaluationUtils.computeWeights(target));

 
   
    DTGraph<String,String> sGraph = org.nodes.data.RDF.createDirectedGraph(dataset.getStatements(null, null, null, inference), null, null);
    List<DTNode<String,String>> hubs = SlashBurn.getHubs(sGraph, 1, true);
View Full Code Here

    }
    linParms.setWeightLabels(wLabels);
    linParms.setWeights(weights);
   

    LibSVMParameters svmParms = new LibSVMParameters(LibSVMParameters.C_SVC, cs);
    svmParms.setNumFolds(10);
   
   

    ResultsTable resTable = new ResultsTable();
    resTable.setManWU(0.05);
View Full Code Here

    }
    linParms.setWeightLabels(wLabels);
    linParms.setWeights(weights);
   

    LibSVMParameters svmParms = new LibSVMParameters(LibSVMParameters.C_SVC, cs);
    svmParms.setNumFolds(10);
   
   

    ResultsTable resTable = new ResultsTable();
    resTable.setManWU(0.05);
View Full Code Here

    boolean inference = false;


    createAffiliationPredictionDataSet(1);

    LibSVMParameters svmParms = new LibSVMParameters(LibSVMParameters.C_SVC, cs);
    svmParms.setNumFolds(10);
   
    ResultsTable resTable = new ResultsTable();
    resTable.setDigits(2);

    for (int depth : depths) {
View Full Code Here

    evalFuncs.add(new Error());
    evalFuncs.add(new F1());

    List<Double> target = EvaluationUtils.createTarget(labels);

    LibSVMParameters svmParms = new LibSVMParameters(LibSVMParameters.C_SVC, cs);
    svmParms.setNumFolds(10);

    //svmParms.setWeightLabels(EvaluationUtils.computeWeightLabels(target));
    //svmParms.setWeights(EvaluationUtils.computeWeights(target));
    //---------
View Full Code Here

    }
    linParms.setWeightLabels(wLabels);
    linParms.setWeights(weights);
   

    LibSVMParameters svmParms = new LibSVMParameters(LibSVMParameters.C_SVC, cs);
    svmParms.setNumFolds(10);
   
   

    ResultsTable resTable = new ResultsTable();
    resTable.setManWU(0.05);
View Full Code Here

    boolean inference = true;

    dataset = new RDFFileDataSet(dataDir, RDFFormat.NTRIPLES);
    createGeoDataSet(1, 1, 10, "http://data.bgs.ac.uk/ref/Lexicon/hasLithogenesis");

    LibSVMParameters svmParms = new LibSVMParameters(LibSVMParameters.C_SVC, cs);
    svmParms.setNumFolds(10);
   
    ResultsTable resTable = new ResultsTable();
    resTable.setDigits(2);

    for (int depth : depths) {
View Full Code Here

TOP

Related Classes of org.data2semantics.proppred.learners.libsvm.LibSVMParameters

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.