Package org.data2semantics.proppred.learners.evaluation

Examples of org.data2semantics.proppred.learners.evaluation.Accuracy


    boolean inference = false;
         

    List<EvaluationFunction> evalFuncs = new ArrayList<EvaluationFunction>();
    evalFuncs.add(new Accuracy());
    evalFuncs.add(new F1());

    for (double frac : fractions) {
      createGeoDataSet((int)(1000 * frac), frac, seed, "http://data.bgs.ac.uk/ref/Lexicon/hasTheme");
      List<Double> target = EvaluationUtils.createTarget(labels);
View Full Code Here


    double fraction = 0.1;

    dataset = new RDFFileDataSet("datasets\\Stadsverkeer.ttl", RDFFormat.TURTLE);

    List<EvaluationFunction> evalFuncs = new ArrayList<EvaluationFunction>();
    evalFuncs.add(new Accuracy());
    evalFuncs.add(new F1());




    ResultsTable resTable = new ResultsTable();
    resTable.setManWU(0.05);
    resTable.setDigits(3);

    boolean inference = true;
    for (int d : depths) {
      resTable.newRow("");
      for (int it : iterations) {

        List<List<Result>> res = new ArrayList<List<Result>>();
        for (long seed : seeds) {
          long[] s2 = {seed};

          loadDataSet(fraction, seed);

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

          LibLINEARParameters linParms = new LibLINEARParameters(LibLINEARParameters.SVC_DUAL, cs);
          linParms.setEvalFunction(new Accuracy());
          linParms.setDoCrossValidation(false);
          linParms.setSplitFraction((float) 0.8);
          linParms.setEps(0.1);

          Map<Double, Double> counts = EvaluationUtils.computeClassCounts(targets);
View Full Code Here

    createGeoDataSet(10, 0.1, 1, "http://data.bgs.ac.uk/ref/Lexicon/hasUnitClass");
    List<Double> target = EvaluationUtils.createTarget(labels);


    List<EvaluationFunction> evalFuncs = new ArrayList<EvaluationFunction>();
    evalFuncs.add(new Accuracy());
    evalFuncs.add(new F1());

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

  public LibLINEARParameters(int algorithm) {
    this.algorithm = algorithm;
   
    switch (algorithm) {
    case SVC_DUAL:   solver = SolverType.L2R_L2LOSS_SVC_DUAL;
    evalFunction = new Accuracy();
    break;
    case SVC_PRIMAL: solver = SolverType.L2R_L2LOSS_SVC;
    evalFunction = new Accuracy();
    break;
    case SVR_DUAL: solver = SolverType.L2R_L2LOSS_SVR_DUAL;
    evalFunction = new MeanSquaredError();
    break;
    case SVR_PRIMAL: solver = SolverType.L2R_L2LOSS_SVR;
    evalFunction = new MeanSquaredError();
    break;
    case LR_DUAL: solver = SolverType.L2R_LR_DUAL;
    evalFunction = new Accuracy();
    break;
    case LR_PRIMAL: solver = SolverType.L2R_LR;
    evalFunction = new Accuracy();
    break;
    default: solver = SolverType.L2R_L2LOSS_SVC_DUAL;
    evalFunction = new Accuracy();
    break;
    }

    verbose = false;
    bias = -1;
View Full Code Here

    parms.setWeights(EvaluationUtils.computeWeights(target));
   
    // For simplicity we do CV, but kernel can also be split in train/test split, which is slightly more involved.
    Prediction[] pred = LibSVM.crossValidate(matrix, EvaluationUtils.target2Doubles(target), parms, 5);

    System.out.println("Acc: " + (new Accuracy()).computeScore(EvaluationUtils.target2Doubles(target), pred));
    System.out.println("F1:  " + (new F1()).computeScore(EvaluationUtils.target2Doubles(target), pred));
   
  }
View Full Code Here

    List<Double> testLabels = target.subList(100, target.size());

    for (int i = 0; i < predictions.length; i++) {
      System.out.println("Label: " + revMap.get(testLabels.get(i)) + ", Predicted: " + revMap.get(predictions[i].getLabel()));
    }
    System.out.println("Accuracy: " + (new Accuracy()).computeScore(EvaluationUtils.target2Doubles(testLabels), predictions))
   

  }
View Full Code Here

    ps[0] = 0.1;

    switch (algorithm) {
    case EPSILON_SVR: evalFunction = new MeanSquaredError(); break;
    case NU_SVR: evalFunction = new MeanSquaredError(); break;
    default: evalFunction = new Accuracy();

    }

    numFolds = 10;
  }
View Full Code Here

TOP

Related Classes of org.data2semantics.proppred.learners.evaluation.Accuracy

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.