A wrapper around any learner that reweights observations. This reweighted is intended for time series, and ultimately assigns weights to losses. This learner is particularly useful as a metalearner wrapper. It can be used to create a time-adaptive ensemble, where a super learner is created in a manner that places more weight (with max weight of 1) on recent losses, and less weight is placed on losses further in the past.

Format

R6Class object.

Value

Learner object with methods for training and prediction. See Lrnr_base for documentation on learners.

Parameters

learner

The learner to wrap

folds=NULL

An origami folds object. If NULL, folds from the task are used

full_fit=FALSE

If TRUE, also fit the underlying learner on the full data. This can then be accessed with predict_fold(task, fold_number="full")

window

Observations corresponding to times outside of the window are assigned weight of 0, and obervations corresponding to times within the window are assigned weight of 1. The window is defined with respect to the difference from the maximum time, where all times are obtained from the task node for time. For example, if the maximum time is 100 and the window is 10, then obervations corresponding to times 90-100 are assigned weight 1 and obervations for times 1-89 are assigned weight 0. If rate is provided with window, then times within the window are assigned according to the rate argument (and potentially delay_decay), and the times outside of the window are still assigned weight of 0.

rate

A rate of decay to apply to the losses, where the decay function is (1-rate)^lag and the lag is the difference from all times to the maximum time.

delay_decay

The amount of time to delay decaying weights, for optional use with rate argument. The delay decay is subtracted from the lags, such that lags less than the delay decay have lag of 0 and thus weight of 1. For example, a delay decay of 10 assigns weight 1 to observations that are no more than 10 time points away from the maximum time; and for observations that are more than 10 time points away from the maximum time, the weight is assigned according to the decay function. In this example, observations corresponding to 11 time points away from the maximum time would be assigned lag=1, 11-10, when setting the weights with respect to (1-rate)^lag.

...

Not currently used.