|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fzi.kadmos.evaluator.impl.PrecRecEvaluatorTest
public class PrecRecEvaluatorTest
Test class for the classical precision / recall evaluator PrecRecEvaluatorImpl
.
Constructor Summary | |
---|---|
PrecRecEvaluatorTest()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrecRecEvaluatorTest()
Method Detail |
---|
public static void setUpBeforeClass() throws Exception
Exception
public final void testInitNullReference() throws Exception
null
reference is given as parameter
for the PrecRecEvaluatorImpl.getInstance(Alignment)
method, an IllegalArgumentException
is expected.
Exception
public final void testGetPrecisionNullReference() throws Exception
null
reference is given as parameter
for the PrecRecEvaluatorImpl.getPrecision(Alignment)
method, an IllegalArgumentException
is expected.
Exception
public final void testGetRecallNullReference() throws Exception
null
reference is given as parameter
for the PrecRecEvaluatorImpl.getRecall(Alignment)
method, an IllegalArgumentException
is expected.
Exception
public final void testGetFMeasureNullReference() throws Exception
null
reference is given as parameter
for the PrecRecEvaluatorImpl.getFMeasure(Alignment)
method, an IllegalArgumentException
is expected.
Exception
public final void testInstanceCaching() throws Exception
Alignment
,
the same PrecRecEvaluatorImpl
instance is provided. If
different reference Alignment
s are used, different instances
are provided.
Exception
public final void testGetPrecisionEmptyAlignment() throws Exception
PrecRecEvaluator.getPrecision(Alignment)
.
Empty alignment, non-empty reference alignment.
Expected: NaN
Exception
public final void testGetPrecisionEmptyReferenceAlignment() throws Exception
PrecRecEvaluator.getPrecision(Alignment)
.
Non-empty alignment, empty reference alignment.
Expected: 0.0
Exception
public final void testGetPrecisionEqualAlignmentAndReference() throws Exception
PrecRecEvaluator.getPrecision(Alignment)
.
Equal alignment and reference alignment.
Expected: 1.0
Exception
public final void testGetPrecisionAllCorrectButIncomplete() throws Exception
PrecRecEvaluator.getPrecision(Alignment)
.
All correct, but reference contains more.
Expected: 1.0
Exception
public final void testGetPrecisionOneOfTwoCorrect() throws Exception
PrecRecEvaluator.getPrecision(Alignment)
.
1 of 2 correct.
Expected: 0.5
Exception
public final void testGetPrecisionTwoOfFourCorrect() throws Exception
PrecRecEvaluator.getPrecision(Alignment)
.
2 of 4 correct.
Expected: 0.5
Exception
public final void testGetPrecisionIncompatibleOntology1() throws Exception
PrecRecEvaluator.getPrecision(Alignment)
.
Different ontology 1 in alignment reference.
Expected: IncompatibleAlignmentsException
Exception
public final void testGetPrecisionIncompatibleOntology2() throws Exception
PrecRecEvaluator.getPrecision(Alignment)
.
Different ontology 2 in alignment and reference.
Expected: IncompatibleAlignmentsException
Exception
public final void testGetRecallEmptyAlignment() throws Exception
PrecRecEvaluator.getRecall(Alignment)
.
Empty alignment, non-empty reference alignment.
Expected: 0.0
Exception
public final void testGetRecallEmptyReferenceAlignment() throws Exception
PrecRecEvaluator.getRecall(Alignment)
.
Non-empty alignment, empty reference alignment.
Expected: NaN
Exception
public final void testGetRecallEqualAlignmentAndReference() throws Exception
PrecRecEvaluator.getRecall(Alignment)
.
Equal alignment and reference alignment.
Expected: 1.0
Exception
public final void testGetRecallContainsAllButMore() throws Exception
PrecRecEvaluator.getRecall(Alignment)
.
Contains all from reference, but also some more.
Expected: 1.0
Exception
public final void testGetRecallOneOfTwoContained() throws Exception
PrecRecEvaluator.getRecall(Alignment)
.
1 of 2 contained.
Expected: 0.5
Exception
public final void testGetRecallFourOfEightContained() throws Exception
PrecRecEvaluator.getRecall(Alignment)
.
4 of 8 contained.
Expected: 0.5
Exception
public final void testGetRecallIncompatibleOntology1() throws Exception
PrecRecEvaluator.getRecall(Alignment)
.
Different ontology 1 in alignment reference.
Expected: IncompatibleAlignmentsException
Exception
public final void testGetRecallIncompatibleOntology2() throws Exception
PrecRecEvaluator.getRecall(Alignment)
.
Different ontology 2 in alignment and reference.
Expected: IncompatibleAlignmentsException
Exception
public final void testGetFMeasureEmptyAlignment() throws Exception
PrecRecEvaluator.getFMeasure(Alignment)
.
Empty alignment, non-empty reference alignment.
Expected: NaN
Exception
public final void testGetFMeasureEmptyReferenceAlignment() throws Exception
PrecRecEvaluator.getFMeasure(Alignment)
.
Non-empty alignment, empty reference alignment.
Expected: NaN
Exception
public final void testGetFMeasureEqualAlignmentAndReference() throws Exception
PrecRecEvaluator.getFMeasure(Alignment)
.
Equal alignment and reference alignment.
Expected: 1.0
Exception
public final void testGetFMeasureContainsHalf() throws Exception
PrecRecEvaluator.getRecall(Alignment)
.
Contains half of the correspondences from reference.
Expected: precision=0.5, recall=1.0, f-measure=2/3
Exception
public final void testGetFMeasureAllWrong() throws Exception
PrecRecEvaluator.getFMeasure(Alignment)
.
All wrong.
Expected: 0.0
Exception
public final void testGetFMeasureIncompatibleOntology1() throws Exception
PrecRecEvaluator.getFMeasure(Alignment)
.
Different ontology 1 in alignment reference.
Expected: IncompatibleAlignmentsException
Exception
public final void testGetFMeasureIncompatibleOntology2() throws Exception
PrecRecEvaluator.getFMeasure(Alignment)
.
Different ontology 2 in alignment and reference.
Expected: IncompatibleAlignmentsException
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |