All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dist.edu.umd.hooka.alignment.aer.AER Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
package edu.umd.hooka.alignment.aer;

import java.util.Iterator;

import edu.umd.hooka.Alignment;

public class AER {

	public static float computeAER(Iterator refi, Iterator 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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy