Examples of testBag()


Examples of uk.ac.cam.ch.wwmm.ptc.experimental.classifiers.DecisionList.testBag()

    if(true) {
      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();
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.ptc.experimental.classifiers.DecisionList.testBag()

    if(false) {
      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();
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.ptc.experimental.classifiers.DecisionTree.testBag()

    if(true) {
      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();
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.ptc.experimental.classifiers.DecisionTree.testBag()

      ce = new ClassificationEvaluator();
      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();
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.ptc.experimental.classifiers.MultinomialNaiveBayes.testBag()

    ce = new ClassificationEvaluator();
    MultinomialNaiveBayes mnb = new MultinomialNaiveBayes(bagEvents);
    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));
    }
    System.out.println(ce.getAccuracy());
    System.out.println(ce.getKappa());     
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.ptc.experimental.classifiers.MultinomialNaiveBayes.testBag()

    MultinomialNaiveBayes mnb = new MultinomialNaiveBayes(bagEvents);
    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));
    }
    System.out.println(ce.getAccuracy());
    System.out.println(ce.getKappa());     
    ce.pprintConfusionMatrix();
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.ptc.experimental.classifiers.MultinomialNaiveBayes.testBag()

      MultinomialNaiveBayes mnb = new MultinomialNaiveBayes(eventBags);
      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];
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.ptc.experimental.classifiers.MultinomialNaiveBayes.testBag()

      MultinomialNaiveBayes mnb = new MultinomialNaiveBayes(eventBags);
      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++) {
View Full Code Here

Examples of uk.ac.cam.ch.wwmm.ptc.experimental.classifiers.MultinomialNaiveBayes.testBag()

      ser.write(doc);
     
      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.ptc.experimental.classifiers.MultinomialNaiveBayes.testBag()

     
      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
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.