Skip to content

Commit

Permalink
[Doc] Added HierE2E Favorita baseline (#217)
Browse files Browse the repository at this point in the history
* First iteration of HierE2E execution

* Corrected HierE2E pipeline

* Added relMSE and MSSE evaluation

* Added relMSE and MSSE evaluation

* Added note on available methods and predict_insample methods

* Installed hooks and cleaned notebook

* Fixed missing favicon

* Fixed broken Getting Started quarto link

* Favorita's HierE2E, implied composite likelihood approach

* Favorita's HierE2E, implied composite likelihood approach

* Favorita's HierE2E, implied composite likelihood approach

* Favorita's HierE2E, implied composite likelihood approach

---------

Co-authored-by: Cristian <cristiani.challu@gmail.com>
  • Loading branch information
kdgutier and cchallu authored Jun 26, 2023
1 parent 1419945 commit e070e82
Show file tree
Hide file tree
Showing 2 changed files with 895 additions and 25 deletions.
84 changes: 59 additions & 25 deletions experiments/hierarchical_baselines/nbs/run_favorita_baselines.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,7 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/kin/anaconda3/envs/hierarchical_baselines/lib/python3.10/site-packages/statsforecast/core.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from tqdm.autonotebook import tqdm\n"
]
}
],
"outputs": [],
"source": [
"import os\n",
"import argparse\n",
Expand All @@ -41,21 +32,30 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# %%capture\n",
"# !pip install statsforecast\n",
"# !pip install hierarchicalforecast\n",
"# !pip install git+https://github.com/Nixtla/datasetsforecast@feat/favorita_dataset.git"
"# !pip install git+https://github.com/Nixtla/datasetsforecast.git@feat/favorita_dataset"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/kin/anaconda3/envs/hierarchical_baselines/lib/python3.10/site-packages/statsforecast/core.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from tqdm.autonotebook import tqdm\n"
]
}
],
"source": [
"from statsforecast.core import StatsForecast\n",
"from statsforecast.models import AutoARIMA, Naive\n",
Expand All @@ -77,7 +77,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -166,16 +166,50 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 930M/930M [00:21<00:00, 43.4MiB/s] \n",
"INFO:datasetsforecast.utils:Successfully downloaded favorita-grocery-sales-forecasting2.zip, 930159981, bytes.\n",
"INFO:datasetsforecast.utils:Decompressing zip file...\n",
"INFO:datasetsforecast.utils:Successfully decompressed data/favorita/favorita-grocery-sales-forecasting2.zip\n",
"INFO:datasetsforecast.utils:Decompressing zip file...\n",
"INFO:datasetsforecast.utils:Successfully decompressed data/favorita/holidays_events.csv.zip\n",
"INFO:datasetsforecast.utils:Decompressing zip file...\n",
"INFO:datasetsforecast.utils:Successfully decompressed data/favorita/items.csv.zip\n",
"INFO:datasetsforecast.utils:Decompressing zip file...\n",
"INFO:datasetsforecast.utils:Successfully decompressed data/favorita/oil.csv.zip\n",
"INFO:datasetsforecast.utils:Decompressing zip file...\n",
"INFO:datasetsforecast.utils:Successfully decompressed data/favorita/sample_submission.csv.zip\n",
"INFO:datasetsforecast.utils:Decompressing zip file...\n",
"INFO:datasetsforecast.utils:Successfully decompressed data/favorita/stores.csv.zip\n",
"INFO:datasetsforecast.utils:Decompressing zip file...\n",
"INFO:datasetsforecast.utils:Successfully decompressed data/favorita/test.csv.zip\n",
"INFO:datasetsforecast.utils:Decompressing zip file...\n",
"INFO:datasetsforecast.utils:Successfully decompressed data/favorita/train.csv.zip\n",
"INFO:datasetsforecast.utils:Decompressing zip file...\n",
"INFO:datasetsforecast.utils:Successfully decompressed data/favorita/transactions.csv.zip\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"saved train.csv to train.feather for fast access\n"
]
}
],
"source": [
"data = FavoritaHierarchicalDataset.load_item_data(item_id=1916577, directory = './data/favorita', dataset='Favorita200')"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -280,7 +314,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -293,16 +327,16 @@
"\n",
"Favorita200 item_id=112830, h=34 n_series=93, n_bottom=54 \n",
"test ds=[(Timestamp('2017-07-13 00:00:00'), Timestamp('2017-08-15 00:00:00'))] \n",
"Code block 'Read and Parse data ' took:\t0.56446 seconds\n",
"Code block 'Fit/Predict Model\t ' took:\t0.13728 seconds\n",
"Code block 'Reconcile Predictions ' took:\t35.96450 seconds\n",
"Code block 'Read and Parse data ' took:\t0.60365 seconds\n",
"Code block 'Fit/Predict Model\t ' took:\t30.04792 seconds\n",
"Code block 'Reconcile Predictions ' took:\t38.54011 seconds\n",
"\n",
"\n",
"Favorita200 item_id=1916577, h=34 n_series=93, n_bottom=54 \n",
"test ds=[(Timestamp('2017-07-13 00:00:00'), Timestamp('2017-08-15 00:00:00'))] \n",
"Code block 'Read and Parse data ' took:\t0.58135 seconds\n",
"Code block 'Fit/Predict Model\t ' took:\t0.12099 seconds\n",
"Code block 'Reconcile Predictions ' took:\t35.64888 seconds\n",
"Code block 'Read and Parse data ' took:\t0.61150 seconds\n",
"Code block 'Fit/Predict Model\t ' took:\t29.67945 seconds\n",
"Code block 'Reconcile Predictions ' took:\t38.78811 seconds\n",
"\n",
"\n"
]
Expand Down
Loading

0 comments on commit e070e82

Please sign in to comment.