Description Usage Format Methods
The OnlineSuperLearner uses various SummaryMeasureGenerator
instances
to generate new variables that can be used to represent the relevant history
of a variable. The SMG.Transformation
class allows a user to
transform the current value of a variable using a given function (like a
sin
or cos
).
1 |
An object of class R6ClassGenerator
of length 24.
initialize(function_to_use = sin, suffix = "sin", colnames_to_use)
Initializes a new SMG.Transformation
object.
@param function_to_use function (default = sin) the function to use for transforming a value.
@param suffix string (default = "sin") the string to use as suffix for the generated column names.
@param colnames_to_use vector a vector of string containing all variables for which a transformation needs to be created.
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 with the function specified on initialization.
@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.
process(data.current)
Adds the transformed 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.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.