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

[FIX] Doc fixes #324

Merged
merged 27 commits into from
May 2, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions action_files/readme_com/create_readme_docs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

BASE_DIR="nbs/docs/"
SUB_DIRS=("1_getting_started" "2_capabilities" "2_capabilities/anomaly_detection" "2_capabilities/forecast" "3_deployment" "4_tutorials" "5_use_cases" "7_other_resources")
SUB_DIRS=("1_getting_started" "2_capabilities" "3_deployment" "4_tutorials" "5_use_cases" "7_other_resources")

counter=0
for sub_dir in "${SUB_DIRS[@]}"; do
Expand All @@ -11,7 +11,7 @@ for sub_dir in "${SUB_DIRS[@]}"; do
echo $counter
md_file="${ipynb_file%.ipynb}.md"
md_file="${md_file/docs/_docs/docs}"
quarto render "$ipynb_file" --to md
quarto render "$ipynb_file" --to md --wrap=none
python -m action_files.readme_com.modify_markdown --file_path "$md_file" --slug_number "$counter"
((counter++))
done < <(find "$DIR" -type f -name "*.ipynb" -not -path "*/.ipynb_checkpoints/*" | sort)
Expand Down
5 changes: 3 additions & 2 deletions action_files/readme_com/modify_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def to_snake_case(s):


def merge_lines(md_text):
code_block_pattern = re.compile(r"``` (?:python|bash)([\s\S]*?)```", re.MULTILINE)
code_block_pattern = re.compile(r"``` (?:python|bash|powershell)([\s\S]*?)```", re.MULTILINE)
code_blocks = code_block_pattern.findall(md_text)
md_text_no_code = code_block_pattern.sub("CODEBLOCK", md_text)
lines = md_text_no_code.split("\n")
Expand Down Expand Up @@ -93,7 +93,8 @@ def modify_markdown(
)

# Concatenate new header and modified content
final_content = header + merge_lines(modified_content)
# final_content = header + merge_lines(modified_content)
final_content = header + modified_content

with open(file_path, "w", encoding="utf-8") as file:
file.write(final_content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/1_getting_started/quickstart')"
"colab_badge('docs/1_getting_started/2_quickstart')"
]
},
{
Expand All @@ -55,10 +55,24 @@
"source": [
"## Introduction\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. \n",
"\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",
"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",
"id": "37a1b47c",
"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"
]
},
{
"cell_type": "markdown",
"id": "7b323767",
"metadata": {},
"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."
]
},
Expand All @@ -67,7 +81,7 @@
"id": "5c18e03c-be64-45fe-80d2-eb3c37f3d288",
"metadata": {},
"source": [
"![figure](../../img/timegpt-arch.png)"
"<img src=\"https://github.com/Nixtla/nixtla/blob/main/nbs/img/timegpt-arch.png?raw=true\" alt=\"Figure 1. TimeGPT architecture\">"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,29 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Do you give everyone the keys to your house? Likely not. An **API key** is like a key to a house, and should be kept private. It is a unique string of characters that serves as a key to authenticate your requests to `TimeGPT`. This tutorial will explain how to set up your API key when using the Nixtla SDK. \n",
"\n",
"Upon [registration](https://dashboard.nixtla.io/), you will receive an email asking you to confirm your signup. After confirming, you will receive access to your dashboard. There, under `API Keys`, you will find your API key.\n",
"\n",
"You can follow the API Key Configuration Process detailed in this tutorial. A scematic is given below."
"Do you give everyone the keys to your house? Likely not. An **API key** is like a key to a house, and should be kept private. It is a unique string of characters that serves as a key to authenticate your requests to `TimeGPT`. This tutorial will explain how to set up your API key when using the Nixtla SDK. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Upon [registration](https://dashboard.nixtla.io/), you will receive an email asking you to confirm your signup. After confirming, you will receive access to your dashboard. There, under `API Keys`, you will find your API key."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can follow the API Key Configuration Process detailed in this tutorial. A scematic is given below.\n",
" "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<img src=\"../../img/api_key_process.png?\" alt=\"Figure 1. API key set up process\" width=\"600\"/>"
"<img src=\"https://github.com/Nixtla/nixtla/blob/main/nbs/img/api_key_process.png?raw=true\" alt=\"Figure 1. API key set up process\">"
]
},
{
Expand All @@ -31,8 +42,11 @@
"source": [
"## 1. Unsecure: direct copy and paste \n",
"\n",
"- **Step 1**: Copy the API key found in the `API Keys` of your [dashboard]((https://dashboard.nixtla.io/)). \n",
"- **Step 2**: Instantiate the `NixtlaClient` class by directly pasting your API key into the code, as shown below:"
"This approach is straightforward and best for quick tests or scripts that won’t be shared.\n",
"\n",
"\n",
"- **Step 1**: Copy the API key found in the `API Keys` of your [Nixtla dashboard]((https://dashboard.nixtla.io/)). \n",
"- **Step 2**: Paste the key directly into your Python code, by instantiating the `NixtlaClient` with your API key:"
]
},
{
Expand All @@ -49,8 +63,6 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This approach is straightforward and best for quick tests or scripts that won’t be shared.\n",
"\n",
"::: {.callout-important}\n",
"This approach is considered unsecure, as your API key will be part of your source code.\n",
"::: "
Expand Down Expand Up @@ -109,10 +121,9 @@
"source": [
"### b. Permanent: Using a `.env` file\n",
"\n",
"For a more persistent solution place your API key in a `.env` file located in the folder of your Python script.\n",
"For a more persistent solution place your API key in a `.env` file located in the folder of your Python script. In this file, include the following:\n",
"\n",
"``` bash\n",
"# Inside a file named .env\n",
"``` python\n",
"NIXTLA_API_KEY=your_api_key\n",
"```"
]
Expand All @@ -121,7 +132,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Within Python:** If using a `.env` file, you can load the environment variable within your Python script. Use the `dotenv` package to load the `.env` file and then instantiate the `NIXTLA_API_KEY` class."
"You can now load the environment variable within your Python script. Use the `dotenv` package to load the `.env` file and then instantiate the `NIXTLA_API_KEY` class. For example:"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "6ecd9d32-9178-4768-bffa-d70c93c98311",
"metadata": {},
"source": [
"# Forecast\n",
"# Quickstart Forecast\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. \n",
"\n",
Expand Down Expand Up @@ -46,7 +46,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/2_capabilities/forecast/quickstart')"
"colab_badge('docs/2_capabilities/1_1_quickstart_forecast')"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "6de758ee-a0d2-4b3f-acff-eed419dd17c5",
"metadata": {},
"source": [
"# Anomaly Detection"
"# Quickstart Anomaly Detection"
]
},
{
Expand Down Expand Up @@ -56,7 +56,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/2_capabilities/anomaly_detection/quickstart')"
"colab_badge('docs/2_capabilities/2_1_quickstart_anomaly_detection')"
]
},
{
Expand Down
34 changes: 0 additions & 34 deletions nbs/docs/2_capabilities/overview.ipynb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/4_tutorials/exogenous_variables')"
"colab_badge('docs/4_tutorials/01_exogenous_variables')"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/4_tutorials/holidays')"
"colab_badge('docs/4_tutorials/02_holidays')"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/4_tutorials/categorical_variables')"
"colab_badge('docs/4_tutorials/03_categorical_variables')"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/4_tutorials/longhorizon')"
"colab_badge('docs/4_tutorials/04_longhorizon')"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/4_tutorials/multiple_series')"
"colab_badge('docs/4_tutorials/05_multiple_series')"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/4_tutorials/finetuning')"
"colab_badge('docs/4_tutorials/06_finetuning')"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/4_tutorials/loss_function_finetuning')"
"colab_badge('docs/4_tutorials/07_loss_function_finetuning')"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"outputs": [],
"source": [
"#| echo: false\n",
"colab_badge('docs/4_tutorials/cross_validation')"
"colab_badge('docs/4_tutorials/08_cross_validation')"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/4_tutorials/historical_forecast')"
"colab_badge('docs/4_tutorials/09_historical_forecast')"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "0241d5c1-8d11-4cb9-9259-cda5fffa7ea8",
"metadata": {},
"source": [
"# Uncertainty quantification with quantile forecasts"
"# Uncertainty Quantification with Quantile forecasts"
]
},
{
Expand Down Expand Up @@ -65,7 +65,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/4_tutorials/uncertainty_quantification_with_quantile_forecasts')"
"colab_badge('docs/4_tutorials/10_uncertainty_quantification_with_quantile_forecasts')"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "0241d5c1-8d11-4cb9-9259-cda5fffa7ea8",
"metadata": {},
"source": [
"# Uncertainty quantification with prediction intervals"
"# Uncertainty Quantification with Prediction intervals"
]
},
{
Expand Down Expand Up @@ -65,7 +65,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/4_tutorials/uncertainty_quantification_with_prediction_intervals')"
"colab_badge('docs/4_tutorials/11_uncertainty_quantification_with_prediction_intervals')"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "e620e533-a0ef-4151-8073-dc223b0a78a5",
"metadata": {},
"source": [
"# Forecasting Time Series with Irregular Timestamps\n",
"# Irregular Timestamps\n",
"\n",
"When working with time series data, the frequency of the timestamps is a crucial factor that can significantly impact the forecasting results. Regular frequencies like daily, weekly, or monthly are straightforward to handle. However, irregular frequencies like business days, which exclude weekends, can be challenging for time series forecasting methods.\n",
"\n",
Expand Down Expand Up @@ -44,7 +44,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/4_tutorials/irregular_timestamps')"
"colab_badge('docs/4_tutorials/12_irregular_timestamps')"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/4_tutorials/bounded_forecasts')"
"colab_badge('docs/4_tutorials/13_bounded_forecasts')"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
],
"source": [
"#| echo: false\n",
"colab_badge('docs/4_tutorials/hierarchical_forecasting')"
"colab_badge('docs/4_tutorials/14_hierarchical_forecasting')"
]
},
{
Expand Down Expand Up @@ -156,8 +156,8 @@
"id": "81f2b918",
"metadata": {},
"source": [
"<img src=\"../../img/australia_tourism.png?\" alt=\"Figure 1. Overview of Australia\" width=\"700\"/>\n",
"<img src=\"../../img/australia_hierarchy.png?\" alt=\"Figure 2. Overview of hierarchy of Australia\" width=\"700\"/>"
"<img src=\"https://github.com/Nixtla/nixtla/blob/main/nbs/img/australia_tourism.png?raw=true\" alt=\"Figure 1. Overview of Australia\" width=\"700\">\n",
"<img src=\"https://github.com/Nixtla/nixtla/blob/main/nbs/img/australia_hierarchy.png?raw=true\" alt=\"Figure 2. Overview of hierarchy of Australia\" width=\"700\">"
]
},
{
Expand Down