public abstract class AbstractForecaster extends Object implements TSForecaster, weka.core.CommandlineRunnable, Serializable
Constructor and Description |
---|
AbstractForecaster() |
Modifier and Type | Method and Description |
---|---|
abstract void |
buildForecaster(weka.core.Instances insts,
PrintStream... progress)
Builds a new forecasting model using the supplied training
data.
|
abstract List<List<weka.classifiers.evaluation.NumericPrediction>> |
forecast(int numSteps,
PrintStream... progress)
Produce a forecast for the target field(s).
|
String |
getFieldsToForecast()
Get the fields to forecast.
|
static TSForecaster |
makeCopy(TSForecaster model)
Creates a deep copy of the given forecaster using serialization.
|
void |
postExecution() |
void |
preExecution() |
abstract void |
primeForecaster(weka.core.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 |
run(Object toRun,
String[] options)
Run the supplied object using the supplied options on the command line.
|
void |
runForecaster(TSForecaster forecaster,
String[] options)
Run the supplied forecaster with the supplied options on the command line.
|
void |
setFieldsToForecast(String targets)
Set the names of the fields/attributes in the data to forecast.
|
static List<String> |
stringToList(String list)
A utility method for converting a List of Strings to a single
comma separated String.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
baseModelHasSerializer, clearPreviousState, getAlgorithmName, getPreviousState, loadBaseModel, loadSerializedState, reset, saveBaseModel, serializeState, setPreviousState, usesState
public static List<String> stringToList(String list)
list
- the Listpublic void setFieldsToForecast(String targets) throws Exception
setFieldsToForecast
in interface TSForecaster
targets
- a list of names of fields to forecastException
- if a field(s) can't be found, or if multiple
fields are specified and this forecaster can't predict multiple
fields.public String getFieldsToForecast()
getFieldsToForecast
in interface TSForecaster
public abstract void buildForecaster(weka.core.Instances insts, PrintStream... progress) throws Exception
buildForecaster
in interface TSForecaster
insts
- the training instances.progress
- an optional varargs parameter supplying progress objects
to report toException
- if the model can't be constructed for some
reason.public abstract void primeForecaster(weka.core.Instances insts) throws Exception
primeForecaster
in interface TSForecaster
insts
- the instances to prime the model withException
- if the model can't be primed for some
reason.public abstract List<List<weka.classifiers.evaluation.NumericPrediction>> forecast(int numSteps, PrintStream... progress) throws Exception
forecast
in interface TSForecaster
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 toException
- if the forecast can't be produced for some reason.public void preExecution() throws Exception
preExecution
in interface weka.core.CommandlineRunnable
Exception
public void postExecution() throws Exception
postExecution
in interface weka.core.CommandlineRunnable
Exception
public void run(Object toRun, String[] options) throws IllegalArgumentException
run
in interface weka.core.CommandlineRunnable
toRun
- the object to run.options
- the command line options to pass to the object.Exception
- if the supplied object is not an instance of TSForecaster.IllegalArgumentException
public static TSForecaster makeCopy(TSForecaster model) throws Exception
model
- the forecaster to copyException
- if an error occurspublic void runForecaster(TSForecaster forecaster, String[] options)
runForecaster
in interface TSForecaster
forecaster
- the forecaster to runoptions
- the options to pass to the forecasterCopyright © 2019 University of Waikato, Hamilton, NZ. All Rights Reserved.