Package edu.umd.hooka.alignment.aer

Source Code of edu.umd.hooka.alignment.aer.AER

package edu.umd.hooka.alignment.aer;

import java.util.Iterator;

import edu.umd.hooka.Alignment;

public class AER {

  public static float computeAER(Iterator<ReferenceAlignment> refi, Iterator<Alignment> testi) {
    float num = 0.0f;
    float den = 0.0f;
    while (refi.hasNext()) {
      ReferenceAlignment ref = refi.next();
      Alignment test = testi.next();
      num += (ref.countProbableHits(test) + ref.countSureHits(test));
      den += (test.countAlignmentPoints() + ref.countAlignmentPoints());
    }
    if (testi.hasNext())
      throw new RuntimeException("Mismatch in lengths");
    return num / den;
  }
}
TOP

Related Classes of edu.umd.hooka.alignment.aer.AER

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.