Examples of logEvent()


Examples of uk.ac.cam.ch.wwmm.ptclib.misc.ClassificationEvaluator.logEvent()

        thisncp += Math.log(pdf(ut.get(i,j), ncmeans.get(i), ncstdevs.get(i)));
      }
      String refClass = chemSet.contains(terms.get(j)) ? "CHEM" : "NONCHEM";
      String respClass = thiscp > thisncp ? "CHEM" : "NONCHEM";
      System.out.println(terms.get(j) + "\t" + (thiscp - thisncp));
      ce.logEvent(refClass, respClass);
    }
    System.out.println(ce.getAccuracy());
    System.out.println(ce.getKappa());
    ce.pprintConfusionMatrix();
    ce.pprintPrecisionRecallEval();
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.ptclib.misc.ClassificationEvaluator.logEvent()

      for(int i=0;i<eventBags.size();i++) {
        BagEvent be = eventBags.get(i);
      //for(BagEvent be : eventBags) {
        Map<String,Double> results = mnb.testBag(be.getClassLabel(), be.getFeatures());
        System.out.println(be.getClassLabel() + "\t" + mnb.testBag(be.getFeatures()));
        ce.logEvent(be.getClassLabel(), mnb.bestResult(results));
        String rf = "MNB:" + mnb.bestResult(results);
        Event e = events.get(i);
        String [] sa = new String[e.getContext().length + 1];
        for(int j=0;j<e.getContext().length;j++) {
          sa[j] = e.getContext()[j];
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.ptclib.misc.ClassificationEvaluator.logEvent()

      for(Event event : testData) {
        double [] results = gm.eval(event.getContext());
        String result = results[gm.getIndex("TRUE")] > 0.5 ? "TRUE" : "FALSE";
        //String result = gm.getBestOutcome(results);
        //System.out.println(event.getOutcome() + "\t" + result + "\t" + results[gm.getIndex(event.getOutcome())] + "\t" + StringTools.arrayToList(event.getContext()));
        ce.logEvent(event.getOutcome(), result);
      }
      System.out.println("seed: " + seed);
      System.out.println(ce.getAccuracy());
      System.out.println(ce.getKappa());     
    //}
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.ptclib.misc.ClassificationEvaluator.logEvent()

      DecisionTree dt = new DecisionTree(bagEvents);
      dt.printTree();
      for(int i=0;i<testBagEvents.size();i++) {
        BagEvent be = testBagEvents.get(i);
        String result = dt.testBag(be.getFeatures());
        ce.logEvent(be.getClassLabel(), result);
      }
      System.out.println(ce.getAccuracy());
      System.out.println(ce.getKappa());     
      ce.pprintConfusionMatrix();
      ce.pprintPrecisionRecallEval();
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.ptclib.misc.ClassificationEvaluator.logEvent()

      ce = new ClassificationEvaluator();
      DecisionList dl = new DecisionList(bagEvents);
      for(int i=0;i<testBagEvents.size();i++) {
        BagEvent be = testBagEvents.get(i);
        String result = dl.testBag(be.getFeatures());
        ce.logEvent(be.getClassLabel(), result);
      }
      System.out.println(ce.getAccuracy());
      System.out.println(ce.getKappa());     
      ce.pprintConfusionMatrix();
      ce.pprintPrecisionRecallEval();
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.ptclib.misc.ClassificationEvaluator.logEvent()

      for(int i=0;i<testBagEvents.size();i++) {
        BagEvent be = testBagEvents.get(i);
        //Map<String,Double> results = mnb.testBag(be.getClassLabel(), be.getFeatures());
        Map<String,Double> results = mnb.testBag(be.getFeatures());
        System.out.println(be.getClassLabel() + "\t" + mnb.testBag(be.getFeatures()));
        ce.logEvent(be.getClassLabel(), mnb.bestResult(results));
        if(!be.getClassLabel().equals(mnb.bestResult(results))) {
          System.out.println(be.getFeatures());
          System.out.println(bagsToSentences.get(be.getFeatures()));
        }
      }
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.ptclib.misc.ClassificationEvaluator.logEvent()

      for(Event event : testEvents) {
        double [] results = gm.eval(event.getContext());
        String result = results[gm.getIndex("TRUE")] > 0.5 ? "TRUE" : "FALSE";
        //String result = gm.getBestOutcome(results);
        //System.out.println(event.getOutcome() + "\t" + result + "\t" + results[gm.getIndex(event.getOutcome())] + "\t" + StringTools.arrayToList(event.getContext()));
        ce.logEvent(event.getOutcome(), result);
      }
      System.out.println(ce.getAccuracy());
      System.out.println(ce.getKappa());     
      ce.pprintConfusionMatrix();
      ce.pprintPrecisionRecallEval();     
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.ptclib.misc.ClassificationEvaluator.logEvent()

   
    for(Event event : testData) {
      double [] results = gm.eval(event.getContext());
      String result = gm.getBestOutcome(results);
      System.out.println(event.getOutcome() + "\t" + result + "\t" + results[gm.getIndex(event.getOutcome())] + "\t" + StringTools.arrayToList(event.getContext()));
      ce.logEvent(event.getOutcome(), result);
    }
    System.out.println(ce.getAccuracy());
    System.out.println(ce.getKappa());
    ce.pprintConfusionMatrix();
    ce.pprintPrecisionRecallEval();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.