weka.classifiers.timeseries
Interface TSForecaster

All Known Implementing Classes:
AbstractForecaster, WekaForecaster

public interface TSForecaster

Interface for something that can produce time series predictions.

Version:
$Revision: $
Author:
Mark Hall (mhall{[at]}pentaho{[dot]}com)

Method Summary
 void buildForecaster(Instances insts, java.io.PrintStream... progress)
          Builds a new forecasting model using the supplied training data.
 java.util.List<java.util.List<NumericPrediction>> forecast(int numSteps, java.io.PrintStream... progress)
          Produce a forecast for the target field(s).
 java.lang.String getAlgorithmName()
          Provides a short name that describes the underlying algorithm in some way.
 java.lang.String getFieldsToForecast()
          Get the fields to forecast.
 void primeForecaster(Instances insts)
          Supply the (potentially) trained model with enough historical data, up to and including the current time point, in order to produce a forecast.
 void primeForecasterIncremental(Instance inst)
           
 void reset()
          Reset this forecaster so that it is ready to construct a new model.
 void runForecaster(TSForecaster forecaster, java.lang.String[] options)
          Run the supplied forecaster with the supplied options on the command line.
 void setFieldsToForecast(java.lang.String targets)
          Set the names of the fields/attributes in the data to forecast.
 

Method Detail

getAlgorithmName

java.lang.String getAlgorithmName()
Provides a short name that describes the underlying algorithm in some way.

Returns:
a short description of this forecaster.

reset

void reset()
Reset this forecaster so that it is ready to construct a new model.


setFieldsToForecast

void setFieldsToForecast(java.lang.String targets)
                         throws java.lang.Exception
Set the names of the fields/attributes in the data to forecast.

Parameters:
targets - a list of names of fields to forecast
Throws:
java.lang.Exception - if a field(s) can't be found, or if multiple fields are specified and this forecaster can't predict multiple fields.

getFieldsToForecast

java.lang.String getFieldsToForecast()
Get the fields to forecast.

Returns:
the fields to forecast

buildForecaster

void buildForecaster(Instances insts,
                     java.io.PrintStream... progress)
                     throws java.lang.Exception
Builds a new forecasting model using the supplied training data. The instances in the data are assumed to be sorted in ascending order of time and equally spaced in time. Some methods may not need to implement this method and may instead do their work in the primeForecaster method.

Parameters:
insts - the training instances.
progress - an optional varargs parameter supplying progress objects to report to
Throws:
java.lang.Exception - if the model can't be constructed for some reason.

primeForecaster

void primeForecaster(Instances insts)
                     throws java.lang.Exception
Supply the (potentially) trained model with enough historical data, up to and including the current time point, in order to produce a forecast. Instances are assumed to be sorted in ascending order of time and equally spaced in time.

Parameters:
insts - the instances to prime the model with
Throws:
java.lang.Exception - if the model can't be primed for some reason.

primeForecasterIncremental

void primeForecasterIncremental(Instance inst)
                                throws java.lang.Exception
Throws:
java.lang.Exception

forecast

java.util.List<java.util.List<NumericPrediction>> forecast(int numSteps,
                                                           java.io.PrintStream... progress)
                                                           throws java.lang.Exception
Produce a forecast for the target field(s). Assumes that the model has been built and/or primed so that a forecast can be generated.

Parameters:
numSteps - number of forecasted values to produce for each target. E.g. a value of 5 would produce a prediction for t+1, t+2, ..., t+5.
progress - an optional varargs parameter supplying progress objects to report to
Returns:
a List of Lists (one for each step) of forecasted values for each target
Throws:
java.lang.Exception - if the forecast can't be produced for some reason.

runForecaster

void runForecaster(TSForecaster forecaster,
                   java.lang.String[] options)
Run the supplied forecaster with the supplied options on the command line.

Parameters:
forecaster - the forecaster to run
options - the options to pass to the forecaster