weka.classifiers.timeseries.eval
Class ErrorModule

java.lang.Object
  extended by weka.classifiers.timeseries.eval.TSEvalModule
      extended by weka.classifiers.timeseries.eval.ErrorModule
Direct Known Subclasses:
DACModule, MAEModule, MAPEModule, MSEModule, RAEModule, RRSEModule

public class ErrorModule
extends TSEvalModule

Author:
mhall

Constructor Summary
ErrorModule()
           
 
Method Summary
 double[] calculateMeasure()
          Calculate the measure that this module represents.
 double[] countsForTargets()
           
 void evaluateForInstance(java.util.List<NumericPrediction> forecasts, Instance inst)
          Evaluate the given forecast(s) with respect to the given test instance.
 java.lang.String getDefinition()
          Return the mathematical formula that this evaluation module computes.
 java.lang.String getDescription()
          Return the longer (single sentence) description of this evaluation module
 java.util.List<java.lang.Double> getErrorsForTarget(java.lang.String targetName)
           
 java.lang.String getEvalName()
          Return the short identifying name of this evaluation module
 java.util.List<java.util.List<NumericPrediction>> getPredictionsForAllTargets()
           
 java.util.List<NumericPrediction> getPredictionsForTarget(java.lang.String targetName)
           
 void reset()
          Reset the module
 java.lang.String toString()
           
 java.lang.String toSummaryString()
          Return the summary description of the computed measure for each target.
 
Methods inherited from class weka.classifiers.timeseries.eval.TSEvalModule
getModule, getModuleList, getTargetFields, setTargetFields
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ErrorModule

public ErrorModule()
Method Detail

reset

public void reset()
Description copied from class: TSEvalModule
Reset the module

Specified by:
reset in class TSEvalModule

getEvalName

public java.lang.String getEvalName()
Description copied from class: TSEvalModule
Return the short identifying name of this evaluation module

Specified by:
getEvalName in class TSEvalModule
Returns:
the short identifying name of this evaluation module

getDescription

public java.lang.String getDescription()
Description copied from class: TSEvalModule
Return the longer (single sentence) description of this evaluation module

Specified by:
getDescription in class TSEvalModule
Returns:
the longer description of this module

getDefinition

public java.lang.String getDefinition()
Description copied from class: TSEvalModule
Return the mathematical formula that this evaluation module computes.

Specified by:
getDefinition in class TSEvalModule
Returns:
the mathematical formula that this module computes.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

evaluateForInstance

public void evaluateForInstance(java.util.List<NumericPrediction> forecasts,
                                Instance inst)
                         throws java.lang.Exception
Description copied from class: TSEvalModule
Evaluate the given forecast(s) with respect to the given test instance. Targets with missing values are ignored.

Specified by:
evaluateForInstance in class TSEvalModule
Parameters:
forecasts - a List of forecasted values. Each element corresponds to one of the targets and is assumed to be in the same order as the list of targets supplied to the setTargetFields() method.
Throws:
java.lang.Exception - if the evaluation can't be completed for some reason.

calculateMeasure

public double[] calculateMeasure()
                          throws java.lang.Exception
Description copied from class: TSEvalModule
Calculate the measure that this module represents.

Specified by:
calculateMeasure in class TSEvalModule
Returns:
the value of the measure for this module for each of the target(s).
Throws:
java.lang.Exception - if the measure can't be computed for some reason.

countsForTargets

public double[] countsForTargets()
                          throws java.lang.Exception
Throws:
java.lang.Exception

getErrorsForTarget

public java.util.List<java.lang.Double> getErrorsForTarget(java.lang.String targetName)
                                                    throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getPredictionsForTarget

public java.util.List<NumericPrediction> getPredictionsForTarget(java.lang.String targetName)
                                                          throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getPredictionsForAllTargets

public java.util.List<java.util.List<NumericPrediction>> getPredictionsForAllTargets()

toSummaryString

public java.lang.String toSummaryString()
                                 throws java.lang.Exception
Description copied from class: TSEvalModule
Return the summary description of the computed measure for each target.

Specified by:
toSummaryString in class TSEvalModule
Returns:
the summary string description of the computed measure.
Throws:
java.lang.Exception - if the measure can't be computed for some reason.