gov.sandia.cognition.learning.performance.categorization
Class ConfusionMatrixPerformanceEvaluator<InputType,CategoryType>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.performance.AbstractSupervisedPerformanceEvaluator<InputType,CategoryType,CategoryType,ConfusionMatrix<CategoryType>>
          extended by gov.sandia.cognition.learning.performance.categorization.ConfusionMatrixPerformanceEvaluator<InputType,CategoryType>
Type Parameters:
InputType - The input type of the object to evaluate the performance of.
CategoryType - The category type (output type) to build the confusion matrix over, which is the also the output type of the object to evaluate the performance of.
All Implemented Interfaces:
PerformanceEvaluator<Evaluator<? super InputType,? extends CategoryType>,Collection<? extends InputOutputPair<InputType,CategoryType>>,ConfusionMatrix<CategoryType>>, SupervisedPerformanceEvaluator<InputType,CategoryType,CategoryType,ConfusionMatrix<CategoryType>>, CloneableSerializable, Summarizer<TargetEstimatePair<? extends CategoryType,? extends CategoryType>,ConfusionMatrix<CategoryType>>, Serializable, Cloneable

public class ConfusionMatrixPerformanceEvaluator<InputType,CategoryType>
extends AbstractSupervisedPerformanceEvaluator<InputType,CategoryType,CategoryType,ConfusionMatrix<CategoryType>>

A performance evaluator that builds a confusion matrix.

Since:
3.1
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
protected  Factory<? extends ConfusionMatrix<CategoryType>> factory
          The factory used to create the confusion matrix of the evaluator.
 
Constructor Summary
ConfusionMatrixPerformanceEvaluator()
          Creates a new ConfusionMatrixPerformanceEvaluator with a default factory behind it.
ConfusionMatrixPerformanceEvaluator(Factory<? extends ConfusionMatrix<CategoryType>> factory)
          Creates a new ConfusionMatrixPerformanceEvaluator using the given factory.
 
Method Summary
 ConfusionMatrix<CategoryType> evaluatePerformance(Collection<? extends TargetEstimatePair<? extends CategoryType,? extends CategoryType>> data)
          Evaluates the performance accuracy of the given estimates against the given targets.
 Factory<? extends ConfusionMatrix<CategoryType>> getFactory()
          Gets the factory for the confusion matrix the evaluator creates.
 void setFactory(Factory<? extends ConfusionMatrix<CategoryType>> factory)
          Sets the factory for the confusion matrix the evaluator creates.
 
Methods inherited from class gov.sandia.cognition.learning.performance.AbstractSupervisedPerformanceEvaluator
evaluatePerformance, summarize
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Field Detail

factory

protected Factory<? extends ConfusionMatrix<CategoryType>> factory
The factory used to create the confusion matrix of the evaluator.

Constructor Detail

ConfusionMatrixPerformanceEvaluator

public ConfusionMatrixPerformanceEvaluator()
Creates a new ConfusionMatrixPerformanceEvaluator with a default factory behind it.


ConfusionMatrixPerformanceEvaluator

public ConfusionMatrixPerformanceEvaluator(Factory<? extends ConfusionMatrix<CategoryType>> factory)
Creates a new ConfusionMatrixPerformanceEvaluator using the given factory.

Parameters:
factory - The factory used to create the matrix from the evaluator.
Method Detail

evaluatePerformance

public ConfusionMatrix<CategoryType> evaluatePerformance(Collection<? extends TargetEstimatePair<? extends CategoryType,? extends CategoryType>> data)
Description copied from interface: SupervisedPerformanceEvaluator
Evaluates the performance accuracy of the given estimates against the given targets.

Specified by:
evaluatePerformance in interface SupervisedPerformanceEvaluator<InputType,CategoryType,CategoryType,ConfusionMatrix<CategoryType>>
Specified by:
evaluatePerformance in class AbstractSupervisedPerformanceEvaluator<InputType,CategoryType,CategoryType,ConfusionMatrix<CategoryType>>
Parameters:
data - The target-estimate pairs to use to evaluate performance.
Returns:
The performance evaluation result.

getFactory

public Factory<? extends ConfusionMatrix<CategoryType>> getFactory()
Gets the factory for the confusion matrix the evaluator creates.

Returns:
The factory for the confusion matrix.

setFactory

public void setFactory(Factory<? extends ConfusionMatrix<CategoryType>> factory)
Sets the factory for the confusion matrix the evaluator creates.

Parameters:
factory - The factory for the confusion matrix.