DataType
- The data type to do sequence prediction learning over.LearnedType
- The type of object produced by this learner.public class SequencePredictionLearner<DataType,LearnedType> extends AbstractBatchLearnerContainer<BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends DataType,DataType>>,? extends LearnedType>> implements BatchLearner<java.util.Collection<? extends DataType>,LearnedType>
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PREDICTION_HORIZION
The default prediction horizon is 1.
|
protected int |
predictionHorizon
The prediction horizon, which is the number of samples in the future to
try to learn to predict.
|
learner
Constructor and Description |
---|
SequencePredictionLearner()
Creates a new
SequencePredictionLearner with default parameters. |
SequencePredictionLearner(BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends DataType,DataType>>,? extends LearnedType> learner,
int predictionHorizon)
Creates a new
SequencePredictionLearner with the given learner
and prediction horizon. |
Modifier and Type | Method and Description |
---|---|
static <DataType> MultiCollection<InputOutputPair<DataType,DataType>> |
createPredictionDataset(java.util.Collection<? extends DataType> data,
int predictionHorizon)
Takes a collection and creates a multi-collection of sequences of
input-output pairs that are from the given sequence with the given
prediction horizon.
|
static <DataType> MultiCollection<InputOutputPair<DataType,DataType>> |
createPredictionDataset(MultiCollection<? extends DataType> data,
int predictionHorizon)
Takes a multi-collection and creates a multi-collection of sequences of
input-output pairs that are from the given sequence with the given
prediction horizon.
|
int |
getPredictionHorizion()
Gets the prediction horizon, which is the number of samples ahead in time
that the learner is to predict.
|
LearnedType |
learn(java.util.Collection<? extends DataType> data)
The
learn method creates an object of ResultType using
data of type DataType , using some form of "learning" algorithm. |
LearnedType |
learn(MultiCollection<? extends DataType> data)
Converts the given multi-collection of data sequences to create sequences
of input-output pairs to learn over.
|
void |
setPredictionHorizon(int predictionHorizon)
Sets the prediction horizon, which is the number of samples ahead in time
that the learner is to predict.
|
clone, getLearner, setLearner
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone
public static final int DEFAULT_PREDICTION_HORIZION
protected int predictionHorizon
public SequencePredictionLearner()
SequencePredictionLearner
with default parameters.public SequencePredictionLearner(BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends DataType,DataType>>,? extends LearnedType> learner, int predictionHorizon)
SequencePredictionLearner
with the given learner
and prediction horizon.learner
- The supervised learner to call on the prediction sequence.predictionHorizon
- The prediction horizon, which is the number of samples in the
future to try to learn to predict. It must be a positive number.public LearnedType learn(java.util.Collection<? extends DataType> data)
BatchLearner
learn
method creates an object of ResultType
using
data of type DataType
, using some form of "learning" algorithm.learn
in interface BatchLearner<java.util.Collection<? extends DataType>,LearnedType>
data
- The data that the learning algorithm will use to create an
object of ResultType
.public LearnedType learn(MultiCollection<? extends DataType> data)
data
- The data to learn a prediction over.public static <DataType> MultiCollection<InputOutputPair<DataType,DataType>> createPredictionDataset(java.util.Collection<? extends DataType> data, int predictionHorizon)
DataType
- The data type to create a prediction dataset for.data
- A collection (or multi-collection) to convert into a prediction
collection.predictionHorizon
- The prediction horizon to create the prediction dataset over.
Must be positive.public static <DataType> MultiCollection<InputOutputPair<DataType,DataType>> createPredictionDataset(MultiCollection<? extends DataType> data, int predictionHorizon)
DataType
- The data type to create a prediction dataset for.data
- A collection (or multi-collection) to convert into a prediction
collection.predictionHorizon
- The prediction horizon to create the prediction dataset over.
Must be positive.public int getPredictionHorizion()
public void setPredictionHorizon(int predictionHorizon)
predictionHorizon
- The prediction horizon. Must be positive.