'M5 Forecasting' Challenges Data

Contains functions, which facilitate downloading, loading and preparing data from 'M5 Forecasting' challenges (by 'University of Nicosia', hosted on 'Kaggle'). The data itself is set of time series of different product sales in 'Walmart'. The package also includes a ready-to-use built-in M5 subset named 'tiny_m5'. For detailed information about the challenges, see: Makridakis, S. & Spiliotis, E. & Assimakopoulos, V. (2020). .


m5

CRANstatus Buy hexstciker R-CMD-check

M5 Walmart Challenge Data

Installation

You can install the development version of m5 from GitHub with:

# install.packages("devtools")
devtools::install_github("krzjoa/m5")

Usage

library(m5)
library(zeallot)
library(ggplot2)

DIR <- 'data'

# Downloading the data
m5_download(DIR)

# Loading the data
c(sales_train,
   sales_test,
   sell_prices,
   calendar,
   weights) %<-% m5_get_raw_evaluation(DIR)
   
# Preparing the data
m5_data  <-
   m5_prepare(sales_train, sales_test, calendar, sell_prices)

# Demand classification
m5_demand <- m5_demand_type(m5_data)

foods_1_demand <- 
  m5_demand[startsWith(as.character(m5_demand$item_id), "FOODS_1")]

plot <-
  ggplot(foods_1_demand) +
  geom_point(aes(log(cv2), log(adi),
                 item_id = item_id, col = demand_type)) +
  geom_hline(yintercept = log(1.32)) +
  geom_vline(xintercept = log(0.49)) +
  theme_minimal()

plot

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("m5")

0.1.1 by Krzysztof Joachimiak, 4 years ago


https://github.com/krzjoa/m5, https://krzjoa.github.io/m5/


Report a bug at https://github.com/krzjoa/m5/issues


Browse source code at https://github.com/cran/m5


Authors: Krzysztof Joachimiak [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports data.table, stringi, lubridate

Suggests ggplot2, knitr, testthat, rmarkdown, zeallot


See at CRAN