{
"cells": [
{
"cell_type": "markdown",
"id": "7797e3f8",
"metadata": {},
"source": [
"# Amazon Forecast Accelerator"
]
},
{
"cell_type": "markdown",
"id": "c71c0160",
"metadata": {},
"source": [
"## Important – AWS Resource Requirements\n",
"\n",
"By default, Amazon Forecast Accelerator can process datasets of *up to 5,000 timeseries*\n",
"(1 timeseries = unique SKU x unique Channel) and uses [default AWS service limits for EC2 and Lambda](https://console.aws.amazon.com/servicequotas/).\n",
"*Refer to the table below for resource requirements based on # time-series in your dataset. A limit increase\n",
"will be required for larger data sets.*\n",
"\n",
"| # Timeseries | SageMaker Notebbok Instance Type | # Concurrent Lambdas| [Est. Run-time](#run-time-and-pricing) | [Est. Cost per Forecast (\\$USD) w/ AWS Free-Tier](#run-time-and-pricing) | [Est. Cost per Forecast (\\$USD) w/o AWS Free-Tier](#run-time-and-pricing) |\n",
"|---|---|---|---|---|---|\n",
"| 1–5,000 | ml.t2.medium (default) | 1,000 (default) | 1–5 mins (default) | `<$0.10` | `<$0.30` |\n",
"| | | 10,000[*](#upgrades-and-limit-increases) | 10s–1 min | `<$0.10` | `<$0.30` |\n",
"| 5,000–10,000 | ml.t3.xlarge[*](#upgrades-and-limit-increases) | 1,000 (default) | 5–15min (default) | `<$0.10` | `$0.30–$1.70` |\n",
"| | | 10,000[*](#upgrades-and-limit-increases) | 30s–1.5 min | `<$0.10` | `$0.30–$1.70` |\n",
"| 10,000–50,000 | ml.t3.2xlarge[*](#upgrades-and-limit-increases) | 1,000 (default) | 15–45min (default) | `<$0.10–$2.00` | `$1.70–$9.00` |\n",
"| | | 10,000[*](#upgrades-and-limit-increases) | 30s–1.5 min | `<$0.10–$2.00` | `$1.70–$9.00` |\n",
"| 50,000–100,000 | ml.m4.4xlarge[*](#upgrades-and-limit-increases) | 1,000 (default) | 45+ min (default) | `$2.00–$10.00+` | `$9.00–$16.80+` |\n",
"| | | 10,000[*](#upgrades-and-limit-increases) | 5+ min | `$2.00–$10.00+` | `$9.00–$16.80+` |\n",
"\n",
"### *Upgrades and Limit Increases\n",
"\n",
"A limit increase request is required to process larger datasets, which can be made in one of two ways:\n",
"- Self-Service (~24-48hr):\n",
" - Request a SageMaker Notebook Instance type limit increase [here](https://aws.amazon.com/premiumsupport/knowledge-center/resourcelimitexceeded-sagemaker/).\n",
" - Request an AWS Lambda concurrency limit increase via the instructions [here](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html)\n",
"- Contact your AWS Account Manager (instant approval for SageMaker Notebook Instance type limit increases only)\n",
"\n",
"### Run-time and Pricing\n",
"\n",
"These estimates are for the **statistical forecasting models only** and were based on datasets with\n",
"three years of historical (weekly) demand for each time-series. The machine learning model run-time and costs\n",
"are defined by the Amazon Forecast service and take longer to train (typically hours). Please refer to the\n",
"[Amazon Forecast pricing](https://aws.amazon.com/forecast/pricing/) example for expected costs.\n",
"\n",
"The frequency of the data (e.g. daily, weekly, monthly) significantly impacts the run-time. Datasets\n",
"containing monthly demand will yield the fastest run-times and can typically run using smaller SageMaker Notebook Instance types\n",
"when compared to weekly or daily demand data with the same number of time-series.\n"
]
},
{
"cell_type": "markdown",
"id": "02ad22c1",
"metadata": {},
"source": [
"## Instructions\n",
"\n",
"Please follow the steps below to get started using the dashboard."
]
},
{
"cell_type": "markdown",
"id": "49707d4d",
"metadata": {},
"source": [
"### Step 1 – Prepare your dataset\n",
"\n",
"Your historical demand dataset must be a single CSV (`.csv`) or gzipped CSV (`.csv.gz`) file\n",
"with the following columns:\n",
"\n",
"- `timestamp` – String, date of the demand, in the format `YYYY-mm-dd` (e.g. \"2020-12-25\")\n",
"- `channel` – String, the originating store or platform of the demand (e.g. Website, Store-22)\n",
"- `family` – String, the category of the item (e.g. Shirts)\n",
"- `item_id` – String, the unique item identifier/SKU code (e.g. SKU29292)\n",
"- `demand` – Numeric, the demand amount of the item, which must be >= 0 (e.g. 413) \n",
"\n",
"Each _timeseries_ in a dataset is delineated by its `channel`, `family`, and `item_id` values.\n",
"\n",
"Here is an example of what the file should like:\n",
"```\n",
"timestamp,channel,family,item_id,demand\n",
"2018-07-02,Website,Tops,SKU29292,2\n",
"2018-07-02,Store-22,Footwear,SKU29293,4\n",
"...\n",
"...\n",
"```\n",
"\n",
"**Please ensure that the values in each column is correctly formated prior to generating each forecast.**"
]
},
{
"cell_type": "markdown",
"id": "d0b773a1",
"metadata": {},
"source": [
"### Step 2 – Upload your dataset\n",
"\n",
"Drag-and-drop your file(s) from your OS's file explorer into the SageMaker Notebook file browser to the left of this page, as shown below:\n",
"\n",
"\n",
"\n",
"There will be an upload progress bar at the bottom of the browser window:\n",
"\n",
"\n",
"\n",
"\n",
"#### Troubleshooting\n",
"- If you encounter any issues attempting to upload your files or reports, this can sometimes be remedied by:\n",
" - **refreshing the page in your browser and trying again; or**\n",
" - **running the dashboard inside an \"incognito\" browser window (for Chrome), or a \"private\" browser window (for Firefox).**"
]
},
{
"cell_type": "markdown",
"id": "f5994820",
"metadata": {},
"source": [
"### Step 3 – Accessing the Dashboard\n",
"\n",
"Visit the dashboard below to generate your forecasts:\n",
"\n",
"- **INSERT_URL_HERE**"
]
},
{
"cell_type": "markdown",
"id": "2ed649f9",
"metadata": {},
"source": [
"### Step 4 – Exporting Forecasts and Results\n",
"\n",
"You can export the forecasts and results generated from the dashboard by clicking the\n",
"\"Export\" buttons.\n",
"\n",
"The dashboard is capable of exporting three types of files:\n",
"\n",
"- **top-performers** (`*-top-performers.csv.gz`), which can be used to analyse the forecast accuracy achieved by SKU/Channel/Family for a specific time period.\n",
"\n",
"- **forecasts** (`*-forecasts.csv.gz`), containing your new forecast which uses the best performing model(s) selected \n",
" for each timeseries. You can use this file to: \n",
" \n",
" - Benchmark against an existing forecast for the same period, e.g AWS Forecast vs. actual vs. existing forecast vs. actual.\n",
" - Benchmark against actuals \n",
"\n",
"\n",
"- **backtests** (`*-backtests.csv.gz`), which contain the historical forecast accuracy obtained during the model training and selection process for each timeseries."
]
},
{
"cell_type": "markdown",
"id": "2bdbae7c",
"metadata": {},
"source": [
"### Step 5 – Saving a Report\n",
"\n",
"Reports can be saved and loaded for later use via the \"Save Report\" panel in the dashboard, as shown below:\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"id": "eaa988e2",
"metadata": {},
"source": [
"### Step 6 – Loading a Previously Saved Report\n",
"\n",
"Reports can be loaded via the \"Load Report\" panel in the dashboard, as shown below:\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"id": "41177fdb",
"metadata": {},
"source": [
"## AWS Recommendations"
]
},
{
"cell_type": "markdown",
"id": "9a80c97d",
"metadata": {},
"source": [
"### Shutdown the Notebook Instance when not in use to minimise cost\n",
"\n",
"We recommend that you shut down the notebook instance when:\n",
"\n",
"- when you are waiting for the Machine Learning (ML) Forecasts to complete, which may take several hours depending on the dataset size;\n",
"- after you have exported and downloaded all forecasts, results, and reports.\n",
"\n",
"The notebook instance can be shut down via the AWS Console, as follows:\n",
"\n",
"1. visit https://console.aws.amazon.com/sagemaker/home?#/notebook-instances\n",
"2. select the \"AfaStack-NotebookInstance\" (via the radio button)\n",
"3. select \"Actions\" > \"Stop\"\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"id": "1ba92a1a",
"metadata": {},
"source": [
"### How to permanently delete Amazon Forecast Accelerator from your AWS account\n",
"\n",
"The AWS resources for this deployment can be deleted via the AWS Console, as follows:\n",
"\n",
"1. visit https://console.aws.amazon.com/cloudformation/home?#/stacks\n",
"2. one-at-a-time, select each of the stacks outlined below and click the \"Delete\" button"
]
},
{
"cell_type": "markdown",
"id": "211aa81d",
"metadata": {},
"source": [
""
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}