Skip to content

Commit

Permalink
Clean notebook and use remote URL for dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
marcopeix committed Apr 15, 2024
1 parent 89871af commit 7fd042e
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions nbs/docs/tutorials/2_holidays.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"id": "eb3adafb-65e6-44b4-b1e9-0e12b5ff46ed",
"metadata": {},
"source": [
"Given the predominance usage of calendar variables, we included an automatic creation of common calendar variables to the forecast method as a pre-processing step. To automatically add calendar variables, use the `date_features` argument."
"Given the predominance usage of calendar variables, we included an automatic creation of common calendar variables to the forecast method as a pre-processing step."
]
},
{
Expand All @@ -138,7 +138,7 @@
"metadata": {},
"outputs": [],
"source": [
"df = pd.read_csv('google_trend_chocolate.csv')\n",
"df = pd.read_csv('https://raw.githubusercontent.com/Nixtla/transfer-learning-time-series/main/datasets/google_trend_chocolate.csv')\n",
"df['month'] = pd.to_datetime(df['month']).dt.to_period('M').dt.to_timestamp('M')"
]
},
Expand Down Expand Up @@ -221,6 +221,14 @@
"df.head()"
]
},
{
"cell_type": "markdown",
"id": "7cbcded8",
"metadata": {},
"source": [
"Now, let's create a future dataframe that contains the upcoming holidays in the United States."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -408,6 +416,14 @@
"future_df.head()"
]
},
{
"cell_type": "markdown",
"id": "f32286cb",
"metadata": {},
"source": [
"We do the same steps for the input dataframe."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -635,6 +651,14 @@
"df.tail()\n"
]
},
{
"cell_type": "markdown",
"id": "bcc34ab7",
"metadata": {},
"source": [
"Great! Now, TimeGPT will consider the holidays as exogenous variables and the upcoming holidays will help it make predictions."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -692,6 +716,14 @@
")"
]
},
{
"cell_type": "markdown",
"id": "b75b4388",
"metadata": {},
"source": [
"We can then plot the weights of each holiday to see which are more important in forecasing the interest in chocolate."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down

0 comments on commit 7fd042e

Please sign in to comment.