weka.classifiers.timeseries.eval
Class TSEvaluation

java.lang.Object
  extended by weka.classifiers.timeseries.eval.TSEvaluation

public class TSEvaluation
extends java.lang.Object


Constructor Summary
TSEvaluation(Instances trainingData, double testSplitSize)
           
TSEvaluation(Instances trainingData, Instances testData)
           
 
Method Summary
 void evaluateForecaster(TSForecaster forecaster, boolean buildModel, java.io.PrintStream... progress)
           
 void evaluateForecaster(TSForecaster forecaster, java.io.PrintStream... progress)
          Evaluate the supplied forecaster.
static void evaluateForecaster(TSForecaster forecaster, java.lang.String[] options)
           
 void forecastFuture(TSForecaster forecaster, Instances primeData)
           
 boolean getEvaluateOnTestData()
           
 boolean getEvaluateOnTrainingData()
           
 java.util.List<TSEvalModule> getEvaluationModules()
           
 boolean getForecastFuture()
           
 ErrorModule getPredictionsForTestData(int stepNumber)
          Get predictions for all targets for the specified step number on the test data
 ErrorModule getPredictionsForTrainingData(int stepNumber)
          Get predictions for all targets for the specified step number on the training data
 boolean getPrimeForTestDataWithTestData()
           
 int getPrimeWindowSize()
           
 Instances getTestData()
           
 Instances getTrainingData()
           
 javax.swing.JPanel graphFutureForecastOnTesting(GraphDriver driver, TSForecaster forecaster, java.util.List<java.lang.String> targetNames)
           
 javax.swing.JPanel graphFutureForecastOnTraining(GraphDriver driver, TSForecaster forecaster, java.util.List<java.lang.String> targetNames)
           
 javax.swing.JPanel graphPredictionsForStepsOnTesting(GraphDriver driver, TSForecaster forecaster, java.lang.String targetName, java.util.List<java.lang.Integer> stepsToPlot, int instanceNumberOffset)
           
 javax.swing.JPanel graphPredictionsForStepsOnTraining(GraphDriver driver, TSForecaster forecaster, java.lang.String targetName, java.util.List<java.lang.Integer> stepsToPlot, int instanceNumberOffset)
           
 javax.swing.JPanel graphPredictionsForTargetsOnTesting(GraphDriver driver, TSForecaster forecaster, java.util.List<java.lang.String> graphTargets, int graphStepNum, int primeWindowSize)
           
 javax.swing.JPanel graphPredictionsForTargetsOnTraining(GraphDriver driver, TSForecaster forecaster, java.util.List<java.lang.String> graphTargets, int graphStepNum, int instanceNumberOffset)
           
 java.lang.String printFutureTestForecast(TSForecaster forecaster)
           
 java.lang.String printFutureTrainingForecast(TSForecaster forecaster)
          Print the forecasted values (for all targets) beyond the end of the training data
 java.lang.String printPredictionsForTestData(java.lang.String title, java.lang.String targetName, int stepAhead)
           
 java.lang.String printPredictionsForTestData(java.lang.String title, java.lang.String targetName, int stepAhead, int instanceNumberOffset)
           
 java.lang.String printPredictionsForTrainingData(java.lang.String title, java.lang.String targetName, int stepAhead)
           
 java.lang.String printPredictionsForTrainingData(java.lang.String title, java.lang.String targetName, int stepAhead, int instanceNumberOffset)
           
 void setEvaluateOnTestData(boolean evalOnTest)
           
 void setEvaluateOnTrainingData(boolean evalOnTraining)
           
 void setEvaluationModules(java.lang.String evalModNames)
           
 void setForecastFuture(boolean future)
           
 void setHorizon(int horizon)
           
 void setPrimeForTestDataWithTestData(boolean p)
           
 void setPrimeWindowSize(int primeSize)
           
 void setRebuildModelAfterEachTestForecastStep(boolean r)
           
 void setTestData(Instances testData)
           
 void setTrainingData(Instances train)
           
 java.lang.String toSummaryString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TSEvaluation

public TSEvaluation(Instances trainingData,
                    double testSplitSize)
             throws java.lang.Exception
Throws:
java.lang.Exception

TSEvaluation

public TSEvaluation(Instances trainingData,
                    Instances testData)
             throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

setTrainingData

public void setTrainingData(Instances train)

setTestData

public void setTestData(Instances testData)

getTrainingData

public Instances getTrainingData()

getTestData

public Instances getTestData()

setEvaluateOnTrainingData

public void setEvaluateOnTrainingData(boolean evalOnTraining)

getEvaluateOnTrainingData

public boolean getEvaluateOnTrainingData()

setEvaluateOnTestData

public void setEvaluateOnTestData(boolean evalOnTest)

getEvaluateOnTestData

public boolean getEvaluateOnTestData()

setHorizon

public void setHorizon(int horizon)

setPrimeWindowSize

public void setPrimeWindowSize(int primeSize)

getPrimeWindowSize

public int getPrimeWindowSize()

setPrimeForTestDataWithTestData

public void setPrimeForTestDataWithTestData(boolean p)

getPrimeForTestDataWithTestData

public boolean getPrimeForTestDataWithTestData()

setRebuildModelAfterEachTestForecastStep

public void setRebuildModelAfterEachTestForecastStep(boolean r)

setForecastFuture

public void setForecastFuture(boolean future)

getForecastFuture

public boolean getForecastFuture()

setEvaluationModules

public void setEvaluationModules(java.lang.String evalModNames)
                          throws java.lang.Exception
Throws:
java.lang.Exception

getEvaluationModules

public java.util.List<TSEvalModule> getEvaluationModules()

getPredictionsForTrainingData

public ErrorModule getPredictionsForTrainingData(int stepNumber)
                                          throws java.lang.Exception
Get predictions for all targets for the specified step number on the training data

Parameters:
stepNumber - number of the step into the future to return predictions for
Returns:
the stepNumber step ahead predictions for all targets
Throws:
java.lang.Exception - if there are no predictions available for the training data

getPredictionsForTestData

public ErrorModule getPredictionsForTestData(int stepNumber)
                                      throws java.lang.Exception
Get predictions for all targets for the specified step number on the test data

Parameters:
stepNumber - number of the step into the future to return predictions for
Returns:
the stepNumber step ahead predictions for all targets
Throws:
java.lang.Exception - if there are no predictions available for the test data

evaluateForecaster

public void evaluateForecaster(TSForecaster forecaster,
                               java.io.PrintStream... progress)
                        throws java.lang.Exception
Evaluate the supplied forecaster. Trains the forecaster if a training set has been configured.

Parameters:
forecaster - the forecaster to evaluate
Throws:
java.lang.Exception - if something goes wrong during evaluation

evaluateForecaster

public void evaluateForecaster(TSForecaster forecaster,
                               boolean buildModel,
                               java.io.PrintStream... progress)
                        throws java.lang.Exception
Parameters:
forecaster - the forecaster to evaluate
buildModel - true if the model is to be built (given that there is a training data set to build it with)
Throws:
java.lang.Exception - if something goes wrong during evaluation

forecastFuture

public void forecastFuture(TSForecaster forecaster,
                           Instances primeData)
                    throws java.lang.Exception
Throws:
java.lang.Exception

evaluateForecaster

public static void evaluateForecaster(TSForecaster forecaster,
                                      java.lang.String[] options)
                               throws java.lang.Exception
Throws:
java.lang.Exception

printFutureTestForecast

public java.lang.String printFutureTestForecast(TSForecaster forecaster)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

printFutureTrainingForecast

public java.lang.String printFutureTrainingForecast(TSForecaster forecaster)
                                             throws java.lang.Exception
Print the forecasted values (for all targets) beyond the end of the training data

Parameters:
forecaster - the forecaster
Returns:
A string which contains the predictions for all targets for 1 - horizon number of steps into the future.
Throws:
java.lang.Exception

graphFutureForecastOnTraining

public javax.swing.JPanel graphFutureForecastOnTraining(GraphDriver driver,
                                                        TSForecaster forecaster,
                                                        java.util.List<java.lang.String> targetNames)
                                                 throws java.lang.Exception
Throws:
java.lang.Exception

graphFutureForecastOnTesting

public javax.swing.JPanel graphFutureForecastOnTesting(GraphDriver driver,
                                                       TSForecaster forecaster,
                                                       java.util.List<java.lang.String> targetNames)
                                                throws java.lang.Exception
Throws:
java.lang.Exception

graphPredictionsForStepsOnTraining

public javax.swing.JPanel graphPredictionsForStepsOnTraining(GraphDriver driver,
                                                             TSForecaster forecaster,
                                                             java.lang.String targetName,
                                                             java.util.List<java.lang.Integer> stepsToPlot,
                                                             int instanceNumberOffset)
                                                      throws java.lang.Exception
Throws:
java.lang.Exception

graphPredictionsForStepsOnTesting

public javax.swing.JPanel graphPredictionsForStepsOnTesting(GraphDriver driver,
                                                            TSForecaster forecaster,
                                                            java.lang.String targetName,
                                                            java.util.List<java.lang.Integer> stepsToPlot,
                                                            int instanceNumberOffset)
                                                     throws java.lang.Exception
Throws:
java.lang.Exception

graphPredictionsForTargetsOnTraining

public javax.swing.JPanel graphPredictionsForTargetsOnTraining(GraphDriver driver,
                                                               TSForecaster forecaster,
                                                               java.util.List<java.lang.String> graphTargets,
                                                               int graphStepNum,
                                                               int instanceNumberOffset)
                                                        throws java.lang.Exception
Throws:
java.lang.Exception

graphPredictionsForTargetsOnTesting

public javax.swing.JPanel graphPredictionsForTargetsOnTesting(GraphDriver driver,
                                                              TSForecaster forecaster,
                                                              java.util.List<java.lang.String> graphTargets,
                                                              int graphStepNum,
                                                              int primeWindowSize)
                                                       throws java.lang.Exception
Throws:
java.lang.Exception

printPredictionsForTrainingData

public java.lang.String printPredictionsForTrainingData(java.lang.String title,
                                                        java.lang.String targetName,
                                                        int stepAhead)
                                                 throws java.lang.Exception
Throws:
java.lang.Exception

printPredictionsForTrainingData

public java.lang.String printPredictionsForTrainingData(java.lang.String title,
                                                        java.lang.String targetName,
                                                        int stepAhead,
                                                        int instanceNumberOffset)
                                                 throws java.lang.Exception
Throws:
java.lang.Exception

printPredictionsForTestData

public java.lang.String printPredictionsForTestData(java.lang.String title,
                                                    java.lang.String targetName,
                                                    int stepAhead)
                                             throws java.lang.Exception
Throws:
java.lang.Exception

printPredictionsForTestData

public java.lang.String printPredictionsForTestData(java.lang.String title,
                                                    java.lang.String targetName,
                                                    int stepAhead,
                                                    int instanceNumberOffset)
                                             throws java.lang.Exception
Throws:
java.lang.Exception

toSummaryString

public java.lang.String toSummaryString()
                                 throws java.lang.Exception
Throws:
java.lang.Exception