de.fzi.kadmos.evaluator.impl
Class PrecRecEvaluatorImpl

java.lang.Object
  extended by de.fzi.kadmos.evaluator.impl.PrecRecEvaluatorImpl
All Implemented Interfaces:
Evaluator, PrecRecEvaluator

public class PrecRecEvaluatorImpl
extends Object
implements PrecRecEvaluator

Implementation of a simple precision / recall evaluator. An instance of this evaluator can be obtained via the getInstance() method, which requires a reference alignment. Each instance is immutable wrt. to this reference alignment, however, using the same instance for computing precision and recall measures is not guaranteed to produce the same results, since the reference alignment can change without the evaluator being notified.

Since:
1.0.1
Version:
1.3.0
Author:
Juergen Bock

Method Summary
 double getFMeasure(Alignment alignment)
          Computes and returns the F-Measure of an alignment.
static PrecRecEvaluatorImpl getInstance(Alignment refAlign)
          Gets a (new) instance of this evaluator.
 double getPrecision(Alignment alignment)
          Computes and returns the precision of an alignment.
 double getRecall(Alignment alignment)
          Computes and returns the recall of an alignment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static PrecRecEvaluatorImpl getInstance(Alignment refAlign)
Gets a (new) instance of this evaluator. For any reference Alignment instance there can only be one evaluator instance.

Parameters:
refAlign - The reference Alignment used for evaluating.
Returns:
Evaluator instance.
Since:
1.0.1

getFMeasure

public double getFMeasure(Alignment alignment)
                   throws IncompatibleAlignmentsException
Computes and returns the F-Measure of an alignment.

Specified by:
getFMeasure in interface PrecRecEvaluator
Parameters:
alignment - Alignment, whose F-Measure is to be determined.
Returns:
F-Measure (value between 0 and 1).
Throws:
IncompatibleAlignmentsException - if the alignment refers to different ontologies than the reference alignment.

getPrecision

public double getPrecision(Alignment alignment)
                    throws IncompatibleAlignmentsException
Computes and returns the precision of an alignment.

Specified by:
getPrecision in interface PrecRecEvaluator
Parameters:
alignment - Alignment, whose precision is to be determined.
Returns:
Precision (value between 0 and 1).
Throws:
IncompatibleAlignmentsException - if the alignment refers to different ontologies than the reference alignment.

getRecall

public double getRecall(Alignment alignment)
                 throws IncompatibleAlignmentsException
Computes and returns the recall of an alignment.

Specified by:
getRecall in interface PrecRecEvaluator
Parameters:
alignment - Alignment, whose recall is to be determined.
Returns:
Recall (value between 0 and 1).
Throws:
IncompatibleAlignmentsException - if the alignment refers to different ontologies than the reference alignment.


Copyright © 2012. All Rights Reserved.