Skip to contents

DataBackend for data.table which serves as an efficient in-memory data base.

Super classes

mlr3::DataBackend -> mlr3::DataBackendDataTable -> DataBackendTimeSeries

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Note that DataBackendDataTable does not copy the input data, while as_data_backend() calls data.table::copy(). as_data_backend() also takes care about casting to a data.table() and adds a primary key column if necessary.

Usage

DataBackendTimeSeries$new(data, primary_key, index)

Arguments

Examples

data = tsbox::ts_dt(AirPassengers)
data[, id := 1:.N]
#>            time value    id
#>          <Date> <num> <int>
#>   1: 1949-01-01   112     1
#>   2: 1949-02-01   118     2
#>   3: 1949-03-01   132     3
#>   4: 1949-04-01   129     4
#>   5: 1949-05-01   121     5
#>  ---                       
#> 140: 1960-08-01   606   140
#> 141: 1960-09-01   508   141
#> 142: 1960-10-01   461   142
#> 143: 1960-11-01   390   143
#> 144: 1960-12-01   432   144
b = DataBackendTimeSeries$new(data = data, primary_key = "id", index = "time")