gov.sandia.cognition.learning.performance
Class MeanAbsoluteErrorEvaluator<InputType>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.performance.AbstractSupervisedPerformanceEvaluator<InputType,Double,Double,Double>
          extended by gov.sandia.cognition.learning.performance.MeanAbsoluteErrorEvaluator<InputType>
Type Parameters:
InputType - The type of the input to the evaluator to compute the performance of.
All Implemented Interfaces:
PerformanceEvaluator<Evaluator<? super InputType,? extends Double>,Collection<? extends InputOutputPair<InputType,Double>>,Double>, SupervisedPerformanceEvaluator<InputType,Double,Double,Double>, CloneableSerializable, Summarizer<TargetEstimatePair<? extends Double,? extends Double>,Double>, Serializable, Cloneable

public class MeanAbsoluteErrorEvaluator<InputType>
extends AbstractSupervisedPerformanceEvaluator<InputType,Double,Double,Double>

The MeanAbsoluteError class implements a method for computing the performance of a supervised learner for a scalar function by the mean absolute value between the target and estimated outputs. This can also be referred to as the mean L1 error.

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

Constructor Summary
MeanAbsoluteErrorEvaluator()
          Creates a new instance of MeanAbsoluteError
 
Method Summary
static double compute(Collection<? extends TargetEstimatePair<? extends Double,? extends Double>> data)
          Computes the mean absolute error for the given pairs of values.
 Double evaluatePerformance(Collection<? extends TargetEstimatePair<? extends Double,? extends Double>> data)
          Evaluates the performance accuracy of the given estimates against the given targets.
 
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
 

Constructor Detail

MeanAbsoluteErrorEvaluator

public MeanAbsoluteErrorEvaluator()
Creates a new instance of MeanAbsoluteError

Method Detail

evaluatePerformance

public Double evaluatePerformance(Collection<? extends TargetEstimatePair<? extends Double,? extends Double>> data)
Evaluates the performance accuracy of the given estimates against the given targets.

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

compute

public static double compute(Collection<? extends TargetEstimatePair<? extends Double,? extends Double>> data)
Computes the mean absolute error for the given pairs of values. The absolute value of the difference between the two values in each pair is computed and then the mean over all the values is returned.

Parameters:
data - The data to compute the mean absolute error over.
Returns:
The mean absolute error.