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 7 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
83 changes: 72 additions & 11 deletions nbs/docs/capabilities/anomaly-detection/01_quickstart.ipynb

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

76 changes: 72 additions & 4 deletions nbs/docs/capabilities/anomaly-detection/04_confidence_levels.ipynb

Large diffs are not rendered by default.

84 changes: 73 additions & 11 deletions nbs/docs/capabilities/forecast/01_quickstart.ipynb

Large diffs are not rendered by default.

74 changes: 71 additions & 3 deletions nbs/docs/capabilities/forecast/02_exogenous_variables.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,72 @@
"# Add exogenous variables"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide \n",
"import sys"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"IN_COLAB = 'google.colab' in sys.modules"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"if IN_COLAB:\n",
" %pip install nixtla"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"if not IN_COLAB:\n",
" from nixtla.utils import colab_badge"
]
},
{
"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/02_exogenous_variables.ipynb)"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#| echo: false\n",
"if not IN_COLAB:\n",
" colab_badge('docs/capabilities/forecast/02_exogenous_variables')"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -42,7 +108,8 @@
"outputs": [],
"source": [
"#| hide\n",
"from dotenv import load_dotenv"
"if not IN_COLAB:\n",
" from dotenv import load_dotenv"
]
},
{
Expand All @@ -52,8 +119,9 @@
"outputs": [],
"source": [
"#| hide\n",
"load_dotenv()\n",
"nixtla_client = NixtlaClient()"
"if not IN_COLAB:\n",
" load_dotenv()\n",
" nixtla_client = NixtlaClient()"
]
},
{
Expand Down
81 changes: 71 additions & 10 deletions nbs/docs/capabilities/forecast/03_holidays_special_dates.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,72 @@
"# Add holidays and special dates"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide \n",
"import sys"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"IN_COLAB = 'google.colab' in sys.modules"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"if IN_COLAB:\n",
" %pip install nixtla"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"if not IN_COLAB:\n",
" from nixtla.utils import colab_badge"
]
},
{
"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/01_quickstart.ipynb)"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#| echo: false\n",
"if not IN_COLAB:\n",
" colab_badge('docs/capabilities/forecast/03_holidays_special_dates')"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -42,7 +108,8 @@
"outputs": [],
"source": [
"#| hide\n",
"from dotenv import load_dotenv"
"if not IN_COLAB:\n",
" from dotenv import load_dotenv"
]
},
{
Expand All @@ -52,8 +119,9 @@
"outputs": [],
"source": [
"#| hide\n",
"load_dotenv()\n",
"nixtla_client = NixtlaClient()"
"if not IN_COLAB:\n",
" load_dotenv()\n",
" nixtla_client = NixtlaClient()"
]
},
{
Expand Down Expand Up @@ -118,13 +186,6 @@
"dates = pd.date_range(end='2023-09-01', periods=periods)\n",
"special_dates_df = special_dates(dates)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
89 changes: 85 additions & 4 deletions nbs/docs/capabilities/forecast/04_categorical_variables.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,72 @@
"# Add categorical variables"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide \n",
"import sys"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"IN_COLAB = 'google.colab' in sys.modules"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"if IN_COLAB:\n",
" %pip install nixtla"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"if not IN_COLAB:\n",
" from nixtla.utils import colab_badge"
]
},
{
"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",
" colab_badge('docs/capabilities/forecast/04_categorical_variables')"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -42,7 +108,8 @@
"outputs": [],
"source": [
"#| hide\n",
"from dotenv import load_dotenv"
"if not IN_COLAB:\n",
" from dotenv import load_dotenv"
]
},
{
Expand All @@ -52,8 +119,9 @@
"outputs": [],
"source": [
"#| hide\n",
"load_dotenv()\n",
"nixtla_client = NixtlaClient()"
"if not IN_COLAB:\n",
" load_dotenv()\n",
" nixtla_client = NixtlaClient()"
]
},
{
Expand Down Expand Up @@ -128,7 +196,20 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"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: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"
]
}
],
"source": [
"forecast_df = nixtla_client.forecast(\n",
" df=cat_df, \n",
Expand Down
Loading
Loading