Package cc.mallet.classify

Examples of cc.mallet.classify.Classification


    // as features
    FeatureVector[] fva = new FeatureVector[fvs.size()];

    for (int i = 0; i < ilist.size(); i++) {
      Instance inst = ilist.get(i);
      Classification c = m_tokenClassifiers.classify(inst, ! m_inProduction);
      LabelVector lv = c.getLabelVector();
      AugmentableFeatureVector afv1 = (AugmentableFeatureVector) inst.getData();
      int[] indices = afv1.getIndices();
      AugmentableFeatureVector afv2 = new AugmentableFeatureVector(m_dataAlphabet,
          indices, afv1.getValues(), indices.length + m_predRanks2add.length);
View Full Code Here


    int numCorrect = 0;
//    System.out.println("NumTrials="+numTrials);
    for(int i= classifications.size()-1;
        i >= classifications.size()-numTrials; i--)
    {
      Classification temp = (Classification)classifications.get(i);
      if(temp.bestLabelIsCorrect())
        numCorrect++;
    }
//    System.out.println("Accuracy at cov "+cov+" is "+
    //(double)numCorrect/numTrials);
    return((double)numCorrect/numTrials);
View Full Code Here

  {
    FeatureVector fv = (FeatureVector) instance.getData ();
    assert (instancePipe == null || fv.getAlphabet () == this.instancePipe.getDataAlphabet ());
   
    Node leaf = getLeaf(m_root, fv);
    return new Classification (instance, this, leaf.getGainRatio().getBaseLabelDistribution());
  }
View Full Code Here

TOP

Related Classes of cc.mallet.classify.Classification

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.