Package cc.mallet.classify

Examples of cc.mallet.classify.MaxEntOptimizableByLabelDistribution


      Instance instance = new Instance(data.get(ii).getData(),lv,null,null);
      dataLabeled.add(instance);
    }
   
    // train supervised
    MaxEntOptimizableByLabelDistribution opt = new  MaxEntOptimizableByLabelDistribution(dataLabeled,p);
    opt.setGaussianPriorVariance(pGPV);

    LimitedMemoryBFGS bfgs = new LimitedMemoryBFGS(opt);
    try { bfgs.optimize(); } catch (Exception e) { e.printStackTrace(); }
    bfgs.reset();
    try { bfgs.optimize(); } catch (Exception e) { e.printStackTrace(); }
   
    double value = 0;
    for (MaxEntPRConstraint constraint : q.getConstraintFeatures()) {
      // plus sign because this returns negative values
      value += constraint.getCompleteValueContribution();
    }
    value += entropy + opt.getValue();
    return value;
  }
View Full Code Here

TOP

Related Classes of cc.mallet.classify.MaxEntOptimizableByLabelDistribution

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.