Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Added HierE2E Favorita baseline #217

Merged
merged 16 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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