本文整理汇总了Java中cc.mallet.grmm.learning.ACRFEvaluator.evaluate方法的典型用法代码示例。如果您正苦于以下问题:Java ACRFEvaluator.evaluate方法的具体用法?Java ACRFEvaluator.evaluate怎么用?Java ACRFEvaluator.evaluate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cc.mallet.grmm.learning.ACRFEvaluator
的用法示例。
在下文中一共展示了ACRFEvaluator.evaluate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: callEvaluator
import cc.mallet.grmm.learning.ACRFEvaluator; //导入方法依赖的package包/类
/**
* @return true means stop, false means keep going (opposite of evaluators... ugh!)
*/
protected boolean callEvaluator (ACRF acrf, InstanceList trainingList, InstanceList validationList,
InstanceList testSet, int iter, ACRFEvaluator eval)
{
if (eval == null) return false; // If no evaluator specified, keep going blindly
eval.setOutputPrefix (outputPrefix);
// don't cache test set
boolean wasCached = acrf.isCacheUnrolledGraphs ();
acrf.setCacheUnrolledGraphs (false);
Timing timing = new Timing ();
if (!eval.evaluate (acrf, iter+1, trainingList, validationList, testSet)) {
logger.info ("ACRF trainer: evaluator returned false. Quitting.");
timing.tick ("Evaluation time (iteration "+iter+")");
return true;
}
timing.tick ("Evaluation time (iteration "+iter+")");
// set test set caching back to normal
acrf.setCacheUnrolledGraphs (wasCached);
return false;
}
示例2: evaluate
import cc.mallet.grmm.learning.ACRFEvaluator; //导入方法依赖的package包/类
public boolean evaluate (ACRF acrf, int iter, InstanceList training, InstanceList validation, InstanceList testing)
{
boolean ret = true;
for (Iterator it = evals.iterator (); it.hasNext ();) {
ACRFEvaluator evaluator = (ACRFEvaluator) it.next ();
// Return false (i.e., stop training) if any sub-evaluator does.
ret = ret && evaluator.evaluate (acrf, iter, training, validation, testing);
}
return ret;
}