Learn R Programming

m5 (version 0.1.1)

m5_prepare: Prepare the ready-to-use M5 data in one data.frame

Description

It's a memory-efficient function, which uses data.table under the hood. However, it still not recommended to use this function on PCs with < 16GB RAM. In such case, consider to use a custom solution based on [arrow](https://arrow.apache.org/docs/r/) or [disk.frame](https://diskframe.com/index.html)

Usage

m5_prepare(sales_train, sales_test, calendar, sell_prices)

Value

A data.table composed from input objects, which contains the following columns:

  • item_id

  • dept_id

  • cat_id

  • store_id

  • state_id

  • d - day ordinal number

  • value - number of sold items

  • wm_yr_wk - week identifier

  • weekday - weekday name (character)

  • wday - weekday as an integer

  • month

  • year

  • event_name_1 - special event name, like holidays etc.

  • event_type_1 - special event type

  • event_name_2 - as above

  • event_type_2 - as above

  • snap - promotion flag

  • sell_price

Arguments

sales_train

A data.frame with M5 train data

sales_test

A data.frame with M5 test data

calendar

A data.frame with M5 calendar

sell_prices

A data.frame with M5 sell_prices

Examples

Run this code
library(m5)
library(zeallot)
# \donttest{

m5_download('data')
c(sales_train,
  sales_test,
  sell_prices,
  calendar,
  weights) %<-% m5_get_raw_evaluation('data')

m5_data  <-
   m5_prepare(sales_train, sales_test, calendar, sell_prices)
# }

Run the code above in your browser using DataLab