Skip to content

Commit

Permalink
updates_quickstart_and_intro_tracy
Browse files Browse the repository at this point in the history
  • Loading branch information
elephaint committed May 3, 2024
1 parent a524f8c commit 9236956
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 23 deletions.
45 changes: 41 additions & 4 deletions nbs/docs/getting-started/1_introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# TimeGPT\n",
"# About TimeGPT\n",
"\n",
"TimeGPT is the first foundation model for time series forecasting created by Nixtla.\n",
"\n",
Expand All @@ -17,9 +17,9 @@
"* Forecasting\n",
" + Univariate forecasting\n",
" + Multivariate forecasting\n",
" + Using exogenous variables\n",
" + Including holidays and special dates\n",
" + Using categorical variables\n",
" + Including exogenous variables\n",
" + Adding holidays and special dates\n",
" + Adding categorical variables\n",
" + Long-horizon forecasting\n",
" + Fine-tuning, with user-specified loss functions\n",
" + Cross-validation\n",
Expand All @@ -32,6 +32,43 @@
" + and much more"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Get started with our [QuickStart guide](), walk through [tutorials]() on the different [capabilities](), and learn from real-world [use cases]() in our documentation.**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Overview\n",
"\n",
"Nixtla's TimeGPT is a generative pre-trained forecasting model for time series data. TimeGPT can produce accurate forecasts for new time series without training, using only historical values as inputs. TimeGPT can be used across a plethora of tasks including demand forecasting, anomaly detection, financial forecasting, and more."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The TimeGPT model \"reads\" time series data much like the way humans read a sentence – from left to right. It looks at windows of past data, which we can think of as \"tokens\", and predicts what comes next. This prediction is based on patterns the model identifies in past data and extrapolates into the future."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The API provides an interface to TimeGPT, allowing users to leverage its forecasting capabilities to predict future events. TimeGPT can also be used for other time series-related tasks, such as what-if scenarios, anomaly detection, and more."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<img src=\"https://github.com/Nixtla/nixtla/blob/main/nbs/img/timegpt-arch.png?raw=true\" alt=\"Figure 1. TimeGPT architecture\">"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
74 changes: 55 additions & 19 deletions nbs/docs/getting-started/2_quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "6ecd9d32-9178-4768-bffa-d70c93c98311",
"metadata": {},
"source": [
"# Quickstart\n",
"# TimeGPT Quickstart\n",
"\n",
"> Unlock the power of accurate predictions and confidently navigate uncertainty. Reduce uncertainty and resource limitations.\n",
"> With TimeGPT, you can effortlessly access state-of-the-art models to make data-driven decisions. Whether you're a bank\n",
Expand Down Expand Up @@ -33,7 +33,7 @@
{
"data": {
"text/markdown": [
"[![](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Nixtla/nixtla/blob/main/nbs/docs/getting-started/2_quickstart.ipynb)"
"[![](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Nixtla/nixtla/blob/main/nbs/docs/getting_started/2_quickstart.ipynb)"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
Expand All @@ -45,51 +45,86 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/getting-started/2_quickstart')"
"colab_badge('docs/getting_started/2_quickstart')"
]
},
{
"cell_type": "markdown",
"id": "568b7aba-5990-477b-a012-9bd30815cfe3",
"id": "7e5b10a6-b39c-4583-bc2c-ab0b70eeea28",
"metadata": {},
"source": [
"## Introduction\n",
"## Step 1: Create a TimeGPT account and generate your API key\n",
"\n",
"Nixtla's TimeGPT is a generative pre-trained forecasting model for time series data. TimeGPT can produce accurate forecasts for new time series without training, using only historical values as inputs. TimeGPT can be used across a plethora of tasks including demand forecasting, anomaly detection, financial forecasting, and more. "
"* Go to [dashboard.nixtla.io](https://dashboard.nixtla.io/team/1245738/usage)\n",
"* Sign in with Google, GitHub or your email\n",
"* Create your API key by going to 'API Keys' in the menu and clicking on 'Create New API Key'\n",
"* Refresh the page and your API key will be there\n",
" "
]
},
{
"cell_type": "markdown",
"id": "37a1b47c",
"id": "5f30be1a-3eaf-4133-8254-680e8f7cda72",
"metadata": {},
"source": [
"\n",
"The TimeGPT model \"reads\" time series data much like the way humans read a sentence – from left to right. It looks at windows of past data, which we can think of as \"tokens\", and predicts what comes next. This prediction is based on patterns the model identifies in past data and extrapolates into the future.\n"
"## Step 2: Install Nixtla"
]
},
{
"cell_type": "markdown",
"id": "7b323767",
"cell_type": "code",
"execution_count": null,
"id": "f9c7916a-3292-43bb-8f35-44863e1f7931",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: nixtla in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (0.5.0)\n",
"Requirement already satisfied: httpx in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from nixtla) (0.27.0)\n",
"Requirement already satisfied: pandas in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from nixtla) (2.1.4)\n",
"Requirement already satisfied: pydantic in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from nixtla) (1.10.14)\n",
"Requirement already satisfied: requests in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from nixtla) (2.31.0)\n",
"Requirement already satisfied: tenacity in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from nixtla) (8.2.3)\n",
"Requirement already satisfied: utilsforecast>=0.1.7 in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from nixtla) (0.1.7)\n",
"Requirement already satisfied: numpy in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from utilsforecast>=0.1.7->nixtla) (1.23.5)\n",
"Requirement already satisfied: packaging in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from utilsforecast>=0.1.7->nixtla) (24.0)\n",
"Requirement already satisfied: python-dateutil>=2.8.2 in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from pandas->nixtla) (2.9.0)\n",
"Requirement already satisfied: pytz>=2020.1 in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from pandas->nixtla) (2024.1)\n",
"Requirement already satisfied: tzdata>=2022.1 in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from pandas->nixtla) (2024.1)\n",
"Requirement already satisfied: anyio in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from httpx->nixtla) (4.3.0)\n",
"Requirement already satisfied: certifi in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from httpx->nixtla) (2024.2.2)\n",
"Requirement already satisfied: httpcore==1.* in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from httpx->nixtla) (1.0.5)\n",
"Requirement already satisfied: idna in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from httpx->nixtla) (3.7)\n",
"Requirement already satisfied: sniffio in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from httpx->nixtla) (1.3.1)\n",
"Requirement already satisfied: h11<0.15,>=0.13 in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from httpcore==1.*->httpx->nixtla) (0.14.0)\n",
"Requirement already satisfied: typing-extensions>=4.2.0 in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from pydantic->nixtla) (4.11.0)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from requests->nixtla) (3.3.2)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from requests->nixtla) (2.2.1)\n",
"Requirement already satisfied: six>=1.5 in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from python-dateutil>=2.8.2->pandas->nixtla) (1.16.0)\n",
"Requirement already satisfied: exceptiongroup>=1.0.2 in c:\\users\\ospra\\miniconda3\\envs\\nixtla\\lib\\site-packages (from anyio->httpx->nixtla) (1.2.0)\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
" \n",
"The API provides an interface to TimeGPT, allowing users to leverage its forecasting capabilities to predict future events. TimeGPT can also be used for other time series-related tasks, such as what-if scenarios, anomaly detection, and more."
"%pip install nixtla"
]
},
{
"cell_type": "markdown",
"id": "5c18e03c-be64-45fe-80d2-eb3c37f3d288",
"id": "03e24b4f-6b8c-4ffa-82c6-f5b889fdd423",
"metadata": {},
"source": [
"<img src=\"https://github.com/Nixtla/nixtla/blob/main/nbs/img/timegpt-arch.png?raw=true\" alt=\"Figure 1. TimeGPT architecture\">"
"## Step 3: Import the Nixtla TimeGPT client"
]
},
{
"cell_type": "markdown",
"id": "03e24b4f-6b8c-4ffa-82c6-f5b889fdd423",
"id": "f9322614-a82b-44e5-a3b6-5330b8ad7ba6",
"metadata": {},
"source": [
"## Usage"
"In your favorite Python development environment:"
]
},
{
Expand Down Expand Up @@ -151,7 +186,6 @@
"outputs": [],
"source": [
"nixtla_client = NixtlaClient(\n",
" # defaults to os.environ.get(\"NIXTLA_API_KEY\")\n",
" api_key = 'my_api_key_provided_by_nixtla'\n",
")"
]
Expand Down Expand Up @@ -208,14 +242,16 @@
"id": "a2597400",
"metadata": {},
"source": [
"To learn more about how to set up your API key, please refer to the [Setting Up your Authentication Token](https://nixtlaverse.nixtla.io/nixtla/docs/getting-started/setting_up_your_authentication_token.html) tutorial. "
"**This will get you started, but for more secure usage, see [Setting Up your API Key](https://docs.nixtla.io/docs/setting_up_your_api_key).**"
]
},
{
"cell_type": "markdown",
"id": "8ca0d1f7-9730-4146-b6f3-596099ce6e3b",
"metadata": {},
"source": [
"## Step 4: Start making forecasts!\n",
"\n",
"Now you can start making forecasts! Let's import an example on the classic `AirPassengers` dataset. This dataset contains the monthly number of airline passengers in Australia between 1949 and 1960. First, let's load the dataset and plot it:"
]
},
Expand Down

0 comments on commit 9236956

Please sign in to comment.