Skip to content

Commit 2eee373

Browse files
authored
Fix bugs
1 parent b055820 commit 2eee373

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

introduction_to_amazon_algorithms/deepar_retail_forecasting/deepar_retail_forecasting.ipynb

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"\n",
1818
"In this notebook we will see how the [DeepAR forecasting algorithm](https://docs.aws.amazon.com/sagemaker/latest/dg/deepar.html) can help retailers solve these business problems. Using a generated dataset of daily sales for a set of clothing products we will see how DeepAR can learn jointly across the related time series to capture complex group dependent behavior at a categorical level. Finally we will see how this learned categorical behavior can be used to forecast for products with existing time series as well as new \"cold\" products with no existing data.\n",
1919
"\n",
20-
"For a more rigorous explaination of the DeepAR algorithm check out the [DeepAR white paper](https://pdfs.semanticscholar.org/4eeb/e0d12aefeedf3ca85256bc8aa3b4292d47d9.pdf)."
20+
"For a more rigorous explanation of the DeepAR algorithm check out the [DeepAR white paper](https://pdfs.semanticscholar.org/4eeb/e0d12aefeedf3ca85256bc8aa3b4292d47d9.pdf)."
2121
]
2222
},
2323
{
@@ -196,7 +196,7 @@
196196
" \"\"\"\n",
197197
" data = df.copy()\n",
198198
" data = data.groupby(['date', condition]).sum().unstack().fillna(0.0)\n",
199-
" data = data.groupby([(data.index.year),(data.index.month)]).sum()\n",
199+
" data = data.groupby([(data.index.year.rename('year')),(data.index.month.rename('month'))]).sum()\n",
200200
" fig, ax = plt.subplots(figsize=(15,15))\n",
201201
" data.plot(ax=ax)\n",
202202
"\n",
@@ -491,7 +491,7 @@
491491
"metadata": {},
492492
"outputs": [],
493493
"source": [
494-
"your_username = <YOUR_USERNAME_HERE>\n",
494+
"your_username = '<YOUR_USERNAME_HERE>'\n",
495495
"\n",
496496
"resource_prefix = 'deepar-retail-{}'.format(your_username)\n",
497497
"\n",
@@ -718,6 +718,24 @@
718718
"\n",
719719
"print(response)"
720720
]
721+
},
722+
{
723+
"cell_type": "markdown",
724+
"metadata": {},
725+
"source": [
726+
"## Optional cleanup\n",
727+
"\n",
728+
"When you're done with the endpoint, you'll want to clean it up."
729+
]
730+
},
731+
{
732+
"cell_type": "code",
733+
"execution_count": null,
734+
"metadata": {},
735+
"outputs": [],
736+
"source": [
737+
"sess.delete_endpoint(predictor.endpoint)"
738+
]
721739
}
722740
],
723741
"metadata": {

0 commit comments

Comments
 (0)