|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.timeseries.AbstractForecaster
public abstract class AbstractForecaster
Abstract base class implementing TSForecaster that concrete subclasses can extend.
Constructor Summary | |
---|---|
AbstractForecaster()
|
Method Summary | |
---|---|
abstract void |
buildForecaster(Instances insts,
java.io.PrintStream... progress)
Builds a new forecasting model using the supplied training data. |
abstract 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 |
getFieldsToForecast()
Get the fields to forecast. |
static TSForecaster |
makeCopy(TSForecaster model)
Creates a deep copy of the given forecaster using serialization. |
abstract 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 |
run(java.lang.Object toRun,
java.lang.String[] options)
Run the supplied object using the supplied options on the command line. |
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. |
static java.util.List<java.lang.String> |
stringToList(java.lang.String list)
A utility method for converting a List of Strings to a single comma separated String. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface weka.classifiers.timeseries.TSForecaster |
---|
getAlgorithmName, primeForecasterIncremental, reset |
Constructor Detail |
---|
public AbstractForecaster()
Method Detail |
---|
public static java.util.List<java.lang.String> stringToList(java.lang.String list)
list
- the Listpublic void setFieldsToForecast(java.lang.String targets) throws java.lang.Exception
setFieldsToForecast
in interface TSForecaster
targets
- a list of names of fields to forecast
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.public java.lang.String getFieldsToForecast()
getFieldsToForecast
in interface TSForecaster
public abstract void buildForecaster(Instances insts, java.io.PrintStream... progress) throws java.lang.Exception
buildForecaster
in interface TSForecaster
insts
- the training instances.progress
- an optional varargs parameter supplying progress objects
to report to
java.lang.Exception
- if the model can't be constructed for some
reason.public abstract void primeForecaster(Instances insts) throws java.lang.Exception
primeForecaster
in interface TSForecaster
insts
- the instances to prime the model with
java.lang.Exception
- if the model can't be primed for some
reason.public abstract java.util.List<java.util.List<NumericPrediction>> forecast(int numSteps, java.io.PrintStream... progress) throws java.lang.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 to
java.lang.Exception
- if the forecast can't be produced for some reason.public void run(java.lang.Object toRun, java.lang.String[] options) throws java.lang.IllegalArgumentException
run
in interface CommandlineRunnable
toRun
- the object to run.options
- the command line options to pass to the object.
java.lang.Exception
- if the supplied object is not an instance of TSForecaster.
java.lang.IllegalArgumentException
public static TSForecaster makeCopy(TSForecaster model) throws java.lang.Exception
model
- the forecaster to copy
java.lang.Exception
- if an error occurspublic void runForecaster(TSForecaster forecaster, java.lang.String[] options)
runForecaster
in interface TSForecaster
forecaster
- the forecaster to runoptions
- the options to pass to the forecaster
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |