InMemoryData: In memory data class to store data in RAM

Description Format Usage Arguments Details Fields Methods Examples

Description

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

1
2
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 till now. Additionally, using the polynomial base-learner the data.mat is used to control if a intercept should be fitted or not by adding a column containing just ones. It is also possible to add other columns to estimate multiple features simultaneously. Anyway, this is not recommended in terms of unbiased features selection.

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

This class is a wrapper around the pure C++ implementation. To see the functionality of the C++ class visit https://schalkdaniel.github.io/compboost/cpp_man/html/classdata_1_1_in_memory_data.html.

Fields

This class doesn't contain public fields.

Methods

getData()

method extract the data.mat from the data object.

getIdentifier()

method to extract the used name from the data object.

Examples

1
2
3
4
5
6
7
8
9
# 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()
data.obj$getIdentifier()

compboost documentation built on May 2, 2019, 6:40 a.m.