Forecasting examples
This folder contains Python and R examples for building forecasting solutions on the Orange Juice dataset. The examples are presented in Python Jupyter notebooks and R Markdown files, respectively.
Orange Juice Dataset
In this scenario, we will use the Orange Juice (OJ) dataset to forecast its sales. The OJ dataset is from R package bayesm and is part of the Dominick’s dataset.
This dataset contains the following two tables:
- yx.cs. - Weekly sales of refrigerated orange juice at 83 stores. This table has 106139 rows and 19 columns. It includes weekly sales and prices of 11 orange juice brands as well as information about profit, deal, and advertisement for each brand. Note that the weekly sales is captured by a column named
logmove
which corresponds to the natural logarithm of the number of units sold. To get the number of units sold, you need to apply an exponential transform to this column. - storedemo.csv - Demographic information on those stores. This table has 83 rows and 13 columns. For every store, the table describes demographic information of its consumers, distance to the nearest warehouse store, average distance to the nearest 5 supermarkets, ratio of its sales to the nearest warehouse store, and ratio of its sales to the average of the nearest 5 stores.
Note that the week number starts from 40 in this dataset, while the full Dominick’s dataset has data starting from week 1 to week 400. According to Dominick’s Data Manual, week 1 starts on 09/14/1989. Please see pages 40 and 41 of the bayesm reference manual and the Dominick’s Data Manual for more details about the data.
Summary
The following summarizes each directory of the forecasting examples.
Directory | Content | Description |
---|---|---|
python | 00_quick_start/ 01_prepare_data/ 02_model/ 03_model_tune_deploy/ |
<ul> <li> Quick start examples for single-round training </li> <li> Data exploration and preparation notebooks </li> <li> Multi-round training examples </li> <li> Model tuning and deployment example </li> </ul> |
R | 01_dataprep.Rmd 02_basic_models.Rmd 02a_reg_models.Rmd 02b_prophet_models.Rmd |
<ul> <li>Data preparation</li> <li>Basic time series models</li> <li>ARIMA-regression models</li> <li>Prophet models</li> </ul> |