SMG.Mean: SMG.Mean

Description Usage Format Methods

Description

The OnlineSuperLearner uses various SummaryMeasureGenerator instances to generate new variables that can be used to represent the relevant history of a variable. The SMG.Mean class allows a user to include the running mean of a variable. The colname for such a variable is generated with a _mean appendix.

Usage

1

Format

An object of class R6ClassGenerator of length 24.

Methods

initialize(colnames.to.mean)

Initializes a new SMG.Mean object.

@param colnames.to.mean vector a vector containg the names of the variables for which to create a running mean variable.

process(data.current)

Adds the running mean columns for each of the specified colnames. It goes through the data and selects the variables specified on initialization.

@param data.current data.table the currently available data.

@return data.table with the new summary measure columns.

update(data.current)

For online learning we need to be able to create new data blocks on the fly (as not all data is available beforehand. This function updates a set of variables to contain the new version of the running mean.

@param data.current data.table the current data / the last data used for training, from which a new summary measure needs to be generated.

@return data.table a new block for the next training iteration.

exposedVariables

Active method. Returns a list of variables returned by this SMG.

@return vector a vector of strings conaining all specified (used) contemporaneous colnames.

minimalObservations

Active method. The minimal number of measurements needed for this SMG to be able to generate a new block. This is 1.

@return integer the minimal number of measurements needed.


frbl/OnlineSuperLearner documentation built on Feb. 9, 2020, 9:28 p.m.