de.fu_berlin.ties.eval
Class MistakeMatrix

java.lang.Object
  extended by de.fu_berlin.ties.eval.MistakeMatrix

public class MistakeMatrix
extends Object

Stores the results of a mistake analysis performed by MistakeAnalyzer.

Version:
$Revision: 1.10 $, $Date: 2006/10/21 16:04:11 $, $Author: siefkes $
Author:
Christian Siefkes

Constructor Summary
MistakeMatrix()
          Creates a new instance.
 
Method Summary
 void add(Mistake mistake)
          Adds a new mistake to this matrix.
 void printMistakes(Writer writer)
          Prints the list of mistakes encountered by this instance.
 String toString()
          Returns a compact string representation of this object.
 UnmodifiableSortedBag viewExactConfusionMatrix()
          Returns a confusion matrix that counts how often each type was confused with any other type.
 UnmodifiableSortedBag viewMistakeCombinationCount()
          Returns a count of the different mistakes combinations that occurred, using the flattened string representation.
 UnmodifiableSortedBag viewMistakeCount()
          Returns a count of the different types of Mistake.MistakeTypes that occurred.
 UnmodifiableSortedBag viewRoughConfusionMatrix()
          Returns A confusion matrix that counts how often each type was confused with any other type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MistakeMatrix

public MistakeMatrix()
Creates a new instance.

Method Detail

add

public void add(Mistake mistake)
Adds a new mistake to this matrix.

Parameters:
mistake - the mistake

printMistakes

public void printMistakes(Writer writer)
                   throws IOException
Prints the list of mistakes encountered by this instance. Mistakes are printed in original order in the format returned by Mistake.toString(). They are grouped by source files -- each new source file is introduced by a line containing the file name preceded and followed by "---".

Parameters:
writer - the writer to write to
Throws:
IOException - if an I/O error occurred

toString

public String toString()
Returns a compact string representation of this object.

Overrides:
toString in class Object
Returns:
a string representation of this object

viewExactConfusionMatrix

public UnmodifiableSortedBag viewExactConfusionMatrix()
Returns a confusion matrix that counts how often each type was confused with any other type. Stores the strings as used by roughConfusionMatrix. This instance only counts exact confusion instances, where the type confusion was the only mistake that occurred.

Returns:
a read-only view of the attribute

viewMistakeCombinationCount

public UnmodifiableSortedBag viewMistakeCombinationCount()
Returns a count of the different mistakes combinations that occurred, using the flattened string representation.

Returns:
a read-only view of the attribute

viewMistakeCount

public UnmodifiableSortedBag viewMistakeCount()
Returns a count of the different types of Mistake.MistakeTypes that occurred.

Returns:
a read-only view of the attribute

viewRoughConfusionMatrix

public UnmodifiableSortedBag viewRoughConfusionMatrix()
Returns A confusion matrix that counts how often each type was confused with any other type. Stores strings containing the expected answer key and the encountered prediction type as returned by Mistake.confusionType(de.fu_berlin.ties.extract.Extraction, de.fu_berlin.ties.extract.Extraction). This instance counts any confusion instances, no matter whether other mistakes (e.g. early or late start) occurred as well.

Returns:
a read-only view of the attribute


Copyright © 2003-2007 Christian Siefkes. All Rights Reserved.