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] Colab-flag #349

Merged
merged 28 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
40136fa
try_with_not_run_colab
elephaint May 8, 2024
5019ac1
try_not_in_colab
elephaint May 8, 2024
baf36d6
not_run_in_colab
elephaint May 8, 2024
7d3da4f
fix_tutorials
elephaint May 8, 2024
12479fe
Tutorials 1-10 compatible with Colab
marcopeix May 8, 2024
754c4f9
Merge branch 'feature/colab-in-utils' into feature/colab-notebooks
elephaint May 8, 2024
0c73a2d
add_colab_badge_and_colab_flag
elephaint May 8, 2024
c43acf9
refactoring_comments_azul
elephaint May 9, 2024
35a9f03
Merge branch 'main' into feature/colab-notebooks
elephaint May 9, 2024
5f043eb
Merge branch 'main' into feature/colab-notebooks
elephaint May 9, 2024
3a9b9d1
Tutorials 1-10 compatible with Colab
marcopeix May 8, 2024
3ba3b37
try_with_not_run_colab
elephaint May 8, 2024
a8633d9
try_not_in_colab
elephaint May 8, 2024
96ca249
not_run_in_colab
elephaint May 8, 2024
0d43e73
fix_tutorials
elephaint May 8, 2024
1f59a9d
add_colab_badge_and_colab_flag
elephaint May 8, 2024
4aaa236
refactoring_comments_azul
elephaint May 9, 2024
5be6740
try_install_at_top
elephaint May 10, 2024
67cf4fd
fix_conflicts
elephaint May 10, 2024
701df6a
remove_logs
elephaint May 10, 2024
11cca66
fix_all_badges
elephaint May 10, 2024
e94ff6f
fix_first_cell_hide
elephaint May 10, 2024
b0f9f47
try_new_pip_cell
elephaint May 10, 2024
f0c465c
fix_first_cell
elephaint May 10, 2024
e283f21
fix_links_in_badges
elephaint May 10, 2024
1f35beb
pip
elephaint May 13, 2024
3618ef3
Merge branch 'main' into feature/colab-notebooks
elephaint May 13, 2024
e696685
merge_main_and_fix_errors_in_conflict_notebooks
elephaint May 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 69 additions & 13 deletions nbs/docs/capabilities/anomaly-detection/01_quickstart.ipynb

Large diffs are not rendered by default.

72 changes: 70 additions & 2 deletions nbs/docs/capabilities/anomaly-detection/02_anomaly_exogenous.ipynb

Large diffs are not rendered by default.

Large diffs are not rendered by default.

81 changes: 69 additions & 12 deletions nbs/docs/capabilities/anomaly-detection/04_confidence_levels.ipynb

Large diffs are not rendered by default.

88 changes: 69 additions & 19 deletions nbs/docs/capabilities/forecast/01_quickstart.ipynb

Large diffs are not rendered by default.

79 changes: 68 additions & 11 deletions nbs/docs/capabilities/forecast/02_exogenous_variables.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"!pip install -Uqq nixtla"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide \n",
"from nixtla.utils import in_colab"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide \n",
"IN_COLAB = in_colab()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"if not IN_COLAB:\n",
" from nixtla.utils import colab_badge\n",
" from dotenv import load_dotenv"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -13,10 +55,25 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/markdown": [
"[![](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Nixtla/nixtla/blob/main/nbs/docs/capabilities/forecast/02_exogenous_variables.ipynb)"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import pandas as pd\n",
"from nixtla import NixtlaClient"
"#| echo: false\n",
"if not IN_COLAB:\n",
" load_dotenv()\n",
" colab_badge('docs/capabilities/forecast/02_exogenous_variables')"
]
},
{
Expand All @@ -25,10 +82,8 @@
"metadata": {},
"outputs": [],
"source": [
"nixtla_client = NixtlaClient(\n",
" # defaults to os.environ.get(\"NIXTLA_API_KEY\")\n",
" api_key = 'my_api_key_provided_by_nixtla'\n",
")"
"import pandas as pd\n",
"from nixtla import NixtlaClient"
]
},
{
Expand All @@ -37,8 +92,10 @@
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"from dotenv import load_dotenv"
"nixtla_client = NixtlaClient(\n",
" # defaults to os.environ.get(\"NIXTLA_API_KEY\")\n",
" api_key = 'my_api_key_provided_by_nixtla'\n",
")"
]
},
{
Expand All @@ -48,8 +105,8 @@
"outputs": [],
"source": [
"#| hide\n",
"load_dotenv()\n",
"nixtla_client = NixtlaClient()"
"if not IN_COLAB:\n",
" nixtla_client = NixtlaClient()"
]
},
{
Expand Down
91 changes: 68 additions & 23 deletions nbs/docs/capabilities/forecast/03_holidays_special_dates.ipynb
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"cells": [
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Add holidays and special dates\n",
"\n",
"You can create DataFrames specifying holidays for particular countries and specify your own special dates to include them as features for forecasting."
"#| hide\n",
"!pip install -Uqq nixtla"
]
},
{
Expand All @@ -15,10 +16,8 @@
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"from nixtla import NixtlaClient\n",
"from nixtla.date_features import CountryHolidays\n",
"from nixtla.date_features import SpecialDates"
"#| hide \n",
"from nixtla.utils import in_colab"
]
},
{
Expand All @@ -27,10 +26,8 @@
"metadata": {},
"outputs": [],
"source": [
"nixtla_client = NixtlaClient(\n",
" # defaults to os.environ.get(\"NIXTLA_API_KEY\")\n",
" api_key = 'my_api_key_provided_by_nixtla'\n",
")"
"#| hide \n",
"IN_COLAB = in_colab()"
]
},
{
Expand All @@ -40,7 +37,43 @@
"outputs": [],
"source": [
"#| hide\n",
"from dotenv import load_dotenv"
"if not IN_COLAB:\n",
" from nixtla.utils import colab_badge\n",
" from dotenv import load_dotenv"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Add holidays and special dates\n",
"\n",
"You can create DataFrames specifying holidays for particular countries and specify your own special dates to include them as features for forecasting."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"[![](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Nixtla/nixtla/blob/main/nbs/docs/capabilities/forecast/03_holidays_special_dates.ipynb)"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#| echo: false\n",
"if not IN_COLAB:\n",
" load_dotenv()\n",
" colab_badge('docs/capabilities/forecast/03_holidays_special_dates')"
]
},
{
Expand All @@ -49,16 +82,33 @@
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"load_dotenv()\n",
"nixtla_client = NixtlaClient()"
"import pandas as pd\n",
"from nixtla import NixtlaClient\n",
"from nixtla.date_features import CountryHolidays\n",
"from nixtla.date_features import SpecialDates"
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"## Step 2: Get country holidays"
"nixtla_client = NixtlaClient(\n",
" # defaults to os.environ.get(\"NIXTLA_API_KEY\")\n",
" api_key = 'my_api_key_provided_by_nixtla'\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"if not IN_COLAB:\n",
" nixtla_client = NixtlaClient()"
]
},
{
Expand Down Expand Up @@ -91,11 +141,6 @@
"source": [
"For a detailed guide on using special dates and holidays, read our tutorial on [Holidays and special dates](https://docs.nixtla.io/docs/tutorials-holidays_and_special_dates)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
Expand Down
87 changes: 70 additions & 17 deletions nbs/docs/capabilities/forecast/04_categorical_variables.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"!pip install -Uqq nixtla"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide \n",
"from nixtla.utils import in_colab"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide \n",
"IN_COLAB = in_colab()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"if not IN_COLAB:\n",
" from nixtla.utils import colab_badge\n",
" from dotenv import load_dotenv"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -9,6 +51,31 @@
"TimeGPT supports categorical variables and we can create them using `SpecialDates`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"[![](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Nixtla/nixtla/blob/main/nbs/docs/capabilities/forecast/04_categorical_variables.ipynb)"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#| echo: false\n",
"if not IN_COLAB:\n",
" load_dotenv()\n",
" colab_badge('docs/capabilities/forecast/04_categorical_variables')"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -40,18 +107,8 @@
"outputs": [],
"source": [
"#| hide\n",
"from dotenv import load_dotenv"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"load_dotenv()\n",
"nixtla_client = NixtlaClient()"
"if not IN_COLAB:\n",
" nixtla_client = NixtlaClient()"
]
},
{
Expand All @@ -66,6 +123,7 @@
"INFO:nixtla.nixtla_client:Validating inputs...\n",
"INFO:nixtla.nixtla_client:Preprocessing dataframes...\n",
"INFO:nixtla.nixtla_client:Inferred freq: MS\n",
"WARNING:nixtla.nixtla_client:You did not provide X_df. Exogenous variables in df are ignored. To surpress this warning, please add X_df with exogenous variables: christmas_vacations, summer_vacations\n",
"WARNING:nixtla.nixtla_client:The specified horizon \"h\" exceeds the model horizon. This may lead to less accurate forecasts. Please consider using a smaller horizon.\n",
"INFO:nixtla.nixtla_client:Restricting input...\n",
"INFO:nixtla.nixtla_client:Calling Forecast Endpoint...\n"
Expand Down Expand Up @@ -106,11 +164,6 @@
"source": [
"For a detailed guide on using categorical variables for forecasting, read our in-depth tutorial on [Categorical variables](https://docs.nixtla.io/docs/tutorials-categorical_variables)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
Expand Down
Loading
Loading