InMemoryData creates an data object which can be used as source or target object within the base-learner factories of compboost. The convention to initialize target data is to call the constructor without any arguments.

Format

S4 object.

Usage

InMemoryData$new()
InMemoryData$new(data_mat, data_identifier)

Arguments

data_mat [matrix]

Matrix containing the source data. This source data is later transformed to obtain the design matrix a base-learner uses for training.

data_identifier [character(1)]

The name for the data specified in data_mat. Note that it is important to have the same data names for train and evaluation data.

Details

The data_mat needs to suits the base-learner. For instance, the spline base-learner does just take a one column matrix since there are just one dimensional splines at the moment.

The data_mat and data_identifier of a target data object is set automatically by passing the source and target object to a factory. getData() can then be used to access the transformed data of the target object.

Fields

This class doesn't contain public fields.

Methods

getData()

getIdentifier()

Examples

# Sample data: data_mat = cbind(1:10) # Create new data object: data_obj = InMemoryData$new(data_mat, "my_data_name") # Get data and identifier: data_obj$getData()
#> [,1] #> [1,] 1 #> [2,] 2 #> [3,] 3 #> [4,] 4 #> [5,] 5 #> [6,] 6 #> [7,] 7 #> [8,] 8 #> [9,] 9 #> [10,] 10
data_obj$getIdentifier()
#> [1] "my_data_name"