Package cc.mallet.classify

Examples of cc.mallet.classify.Classifier


        f++;
        InstanceList[] fold = cvIter.nextSplit();

        logger.info("Training token classifier on cv fold " + f + " / " + m_numCV + " (size=" + fold[0].size() + ")...");
       
        Classifier foldClassifier = m_trainer.train(fold[0]);
        Trial t1 = new Trial(foldClassifier, fold[0]);
        Trial t2 = new Trial(foldClassifier, fold[1]);

        logger.info("Within-fold accuracy = " + t1.getAccuracy());
        logger.info("Out-of-fold accuracy = " + t2.getAccuracy());
View Full Code Here


      Object instName = instance.getName();
     
      if (! useOutOfFold || ! m_table.containsKey(instName))
        return m_tokenClassifier.classify(instance);
     
      Classifier classifier = (Classifier) m_table.get(instName);

      return classifier.classify(instance);
    }
View Full Code Here

    Pipe clusterPipe = new OverlappingFeaturePipe();
    System.err.println("Training with " + training);
    InstanceList trainList = new InstanceList(clusterPipe);
    trainList.addThruPipe(new ClusterSampleIterator(training, random, 0.5, 100));
    System.err.println("Created " + trainList.size() + " instances.");
    Classifier me = new MaxEntTrainer().train(trainList);
    ClassifyingNeighborEvaluator eval =
      new ClassifyingNeighborEvaluator(me, "YES");
                                          
    Trial trial = new Trial(me, trainList);
    System.err.println(new ConfusionMatrix(trial));
View Full Code Here

          trainingInstances.add(pipe.pipe(inst));
        }
      }
      logger.info("generated " + trainingInstances.size()
          + " training instances");
      Classifier classifier = new MaxEntTrainer().train(trainingInstances);
      logger.info("InfoGain:\n");
      new InfoGain(trainingInstances).printByRank(System.out);
      logger.info("pairwise training accuracy="
          + new Trial(classifier, trainingInstances).getAccuracy());
      NeighborEvaluator neval = new PairwiseEvaluator(classifier, "YES",
View Full Code Here

TOP

Related Classes of cc.mallet.classify.Classifier

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.