Skip to contents

Forecaster

Forecaster

Super class

mlr3::Learner -> Forecaster

Public fields

learner

(Learner)
The learner

lag

(integer(1))
The lag

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage

Forecaster$new(learner, lag)

Arguments

learner

(Learner)

lag

(integer(1))

task

(Task)


Method predict()

Uses the information stored during $train() in $state to create a new Prediction for a set of observations of the provided task.

Usage

Forecaster$predict(task, row_ids = NULL)

Arguments

task

(Task).

row_ids

(integer())
Vector of test indices as subset of task$row_ids. For a simple split into training and test set, see partition().

Returns

Prediction.


Method predict_newdata()

Uses the model fitted during $train() to create a new Prediction based on the forecast horizon n.

Usage

Forecaster$predict_newdata(newdata, task)

Arguments

newdata

(any object supported by as_data_backend())
New data to predict on. All data formats convertible by as_data_backend() are supported, e.g. data.frame() or DataBackend. If a DataBackend is provided as newdata, the row ids are preserved, otherwise they are set to to the sequence 1:nrow(newdata).

task

(Task).

n

(integer(1)).

Returns

Prediction.


Method clone()

The objects of this class are cloneable with this method.

Usage

Forecaster$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.