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

split documentation notebooks by topic #223

Merged
merged 3 commits into from
Sep 29, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,11 @@ Gemfile*
.jekyll-cache

# series files
nbs/data
/**/data/

# nbdev
nbs/_docs
_proc/
index_files
_docs
nbs/data
nbs/docs/**/*.xls*
2 changes: 1 addition & 1 deletion nbs/distributed.models.ray.xgb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"source": [
"# RayXGBForecast\n",
"\n",
"> dask XGBoost forecaster"
"> ray XGBoost forecaster"
]
},
{
Expand Down
503 changes: 0 additions & 503 deletions nbs/docs/electricity_peak_forecasting.ipynb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"source": [
"#| hide\n",
"%load_ext autoreload\n",
"%autoreload 2\n",
"import os\n",
"os.chdir('..')"
"%autoreload 2"
]
},
{
Expand Down Expand Up @@ -210,20 +208,30 @@
{
"cell_type": "code",
"execution_count": null,
"id": "d1f275bf-735f-43c7-994c-0e7430360f5d",
"id": "1b9587c4-3765-4891-9f56-5e45b7605ada",
"metadata": {},
"outputs": [],
"source": [
"fig = plot_series(df, max_insample_length=24 * 14)\n",
"fig.savefig('figs/end_to_end_walkthrough__eda.png', bbox_inches='tight')"
"fig = plot_series(df, max_insample_length=24 * 14)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6c3f8c45-add2-44ba-9bf5-8b24185fec89",
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"fig.savefig('../../figs/end_to_end_walkthrough__eda.png', bbox_inches='tight')"
]
},
{
"cell_type": "markdown",
"id": "2284936b-ac30-4b4b-b7c4-afa2b4059dc2",
"metadata": {},
"source": [
"![](../figs/end_to_end_walkthrough__eda.png)"
"![](../../figs/end_to_end_walkthrough__eda.png)"
]
},
{
Expand Down Expand Up @@ -392,20 +400,30 @@
{
"cell_type": "code",
"execution_count": null,
"id": "cbaad91f-7f67-4a25-a061-96c0f627d432",
"id": "a7a70560-e483-4b16-8a60-12dbc30363b7",
"metadata": {},
"outputs": [],
"source": [
"fig = plot_series(prep)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ec5116c3-6740-498e-95af-e8bdde4cdd9a",
"metadata": {},
"outputs": [],
"source": [
"fig = plot_series(prep)\n",
"fig.savefig('figs/end_to_end_walkthrough__differences.png', bbox_inches='tight')"
"#| hide\n",
"fig.savefig('../../figs/end_to_end_walkthrough__differences.png', bbox_inches='tight')"
]
},
{
"cell_type": "markdown",
"id": "8ab507ad-f2a8-4dde-87ad-5b102c91da0b",
"metadata": {},
"source": [
"![](../figs/end_to_end_walkthrough__differences.png)"
"![](../../figs/end_to_end_walkthrough__differences.png)"
]
},
{
Expand Down Expand Up @@ -1032,7 +1050,7 @@
"id": "7f29f543-ea21-48ca-bb3c-253ceb1be968",
"metadata": {},
"source": [
"If you want to do some transformation to your target before computing the features and then re-apply it after predicting you can use the `target_transforms` argument, which takes a list of transformations. You can find the implemented ones in `mlforecast.target_transforms` or you can implement your own as described in the [target transformations guide](target_transforms_guide.html#custom-transformations)."
"If you want to do some transformation to your target before computing the features and then re-apply it after predicting you can use the `target_transforms` argument, which takes a list of transformations. You can find the implemented ones in `mlforecast.target_transforms` or you can implement your own as described in the [target transformations guide](../how-to-guides/target_transforms_guide.html#custom-transformations)."
]
},
{
Expand Down Expand Up @@ -1394,12 +1412,20 @@
{
"cell_type": "code",
"execution_count": null,
"id": "50c9daf7-5002-4851-b03f-d9c62c3db433",
"id": "d95f87ca-ce35-4756-b4d4-34a6ef17bd01",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ef280687-ba68-4fb0-8c8b-1e3ff13b0056",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"\n",
"np.testing.assert_allclose(preds['Naive'], last_vals['y'])"
]
},
Expand Down Expand Up @@ -1644,20 +1670,30 @@
{
"cell_type": "code",
"execution_count": null,
"id": "ed5ebbe2-5d9e-4898-b8be-6cefff2ac440",
"id": "0a0c694a-560b-4fa7-8193-f7c4eb5dba4a",
"metadata": {},
"outputs": [],
"source": [
"fig = plot_series(df, preds, max_insample_length=24 * 7)\n",
"fig.savefig('figs/end_to_end_walkthrough__predictions.png', bbox_inches='tight')"
"fig = plot_series(df, preds, max_insample_length=24 * 7)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "50b79ccf-1372-4eae-a8eb-6eec1999fea2",
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"fig.savefig('../../figs/end_to_end_walkthrough__predictions.png', bbox_inches='tight')"
]
},
{
"cell_type": "markdown",
"id": "2977ed1b-5b78-4ec5-a5bf-e91f57b374d6",
"metadata": {},
"source": [
"![](../figs/end_to_end_walkthrough__predictions.png)"
"![](../../figs/end_to_end_walkthrough__predictions.png)"
]
},
{
Expand Down Expand Up @@ -2065,20 +2101,30 @@
{
"cell_type": "code",
"execution_count": null,
"id": "e79a786f-a5f0-4034-be17-96283db304ab",
"id": "aa2d6a1a-e0f6-4d7f-9aac-92a19770f23b",
"metadata": {},
"outputs": [],
"source": [
"fig = plot_series(cv_result, cv_result.drop(columns='cutoff'), max_insample_length=0)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2a4528a9-6bde-430f-8bb3-977725ea057a",
"metadata": {},
"outputs": [],
"source": [
"fig = plot_series(cv_result, cv_result.drop(columns='cutoff'), max_insample_length=0)\n",
"fig.savefig('figs/end_to_end_walkthrough__cv.png', bbox_inches='tight')"
"#| hide\n",
"fig.savefig('../../figs/end_to_end_walkthrough__cv.png', bbox_inches='tight')"
]
},
{
"cell_type": "markdown",
"id": "c8d11f3d-0d7e-4c66-a5bb-acdaca176555",
"metadata": {},
"source": [
"![](../figs/end_to_end_walkthrough__cv.png)"
"![](../../figs/end_to_end_walkthrough__cv.png)"
]
},
{
Expand Down Expand Up @@ -2499,20 +2545,30 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c28b5282-9731-4799-a23d-c7feef799206",
"id": "538ed4cb-2e96-4615-ae5f-bab230d80137",
"metadata": {},
"outputs": [],
"source": [
"fig = plot_series(cv.cv_preds_, cv.cv_preds_.drop(columns='window'), max_insample_length=0)\n",
"fig.savefig('figs/end_to_end_walkthrough__lgbcv.png', bbox_inches='tight')"
"fig = plot_series(cv.cv_preds_, cv.cv_preds_.drop(columns='window'), max_insample_length=0)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d5645508-7293-45d8-97a9-8f8c1bac63a0",
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"fig.savefig('../../figs/end_to_end_walkthrough__lgbcv.png', bbox_inches='tight')"
]
},
{
"cell_type": "markdown",
"id": "47e0fcfe-052b-4418-b2c5-62473425b42a",
"metadata": {},
"source": [
"![](../figs/end_to_end_walkthrough__lgbcv.png)"
"![](../../figs/end_to_end_walkthrough__lgbcv.png)"
]
},
{
Expand All @@ -2526,23 +2582,33 @@
{
"cell_type": "code",
"execution_count": null,
"id": "292d31f4-4980-444f-9124-9f4f4a6921ac",
"id": "5158cae8-1424-4c57-8f4a-02d0b65521ee",
"metadata": {},
"outputs": [],
"source": [
"final_fcst = MLForecast.from_cv(cv)\n",
"final_fcst.fit(df)\n",
"preds = final_fcst.predict(48)\n",
"fig = plot_series(df, preds, max_insample_length=24 * 14)\n",
"fig.savefig('figs/end_to_end_walkthrough__final_forecast.png', bbox_inches='tight')"
"fig = plot_series(df, preds, max_insample_length=24 * 14)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7e545230-deb7-41c7-9a87-d837262c2384",
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"fig.savefig('../../figs/end_to_end_walkthrough__final_forecast.png', bbox_inches='tight')"
]
},
{
"cell_type": "markdown",
"id": "dced80f3-8424-4b0c-8bfc-5f8b36954826",
"metadata": {},
"source": [
"![](../figs/end_to_end_walkthrough__final_forecast.png)"
"![](../../figs/end_to_end_walkthrough__final_forecast.png)"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,6 @@
"* `pip install \"mlforecast<0.4.0\"` to install any version prior to 0.4.0"
]
},
{
"cell_type": "markdown",
"id": "3d3acf50-ace7-4c00-b935-36a801c79dc7",
"metadata": {},
"source": [
"#### Distributed training"
]
},
{
"cell_type": "markdown",
"id": "8912889b-cd26-4b37-a43f-bc672cdec9f0",
"metadata": {},
"source": [
"If you want to perform distributed training you have to include the [dask](https://www.dask.org/) extra:\n",
"\n",
"`pip install \"mlforecast[dask]\"`\n",
"\n",
"and also either [LightGBM](https://github.com/microsoft/LightGBM/tree/master/python-package) or [XGBoost](https://xgboost.readthedocs.io/en/latest/install.html#python)."
]
},
{
"cell_type": "markdown",
"id": "6772b367-7e1b-4612-8bcd-26039b2badf3",
Expand Down Expand Up @@ -132,22 +112,22 @@
},
{
"cell_type": "markdown",
"id": "40307de9-f0ec-4f84-a324-8a36d66e7fdb",
"id": "a7207f1c-1b37-4ec1-90fb-05b0ae372372",
"metadata": {},
"source": [
"#### Distributed training"
"### Distributed training"
]
},
{
"cell_type": "markdown",
"id": "83dab9f7-e614-42ef-95c0-a76ae20f74a7",
"id": "be5df835-f2bc-4be6-9ae3-e5723b84d97c",
"metadata": {},
"source": [
"If you want to perform distributed training you also have to install [dask](https://www.dask.org/):\n",
"\n",
"`conda install -c conda-forge dask`\n",
"If you want to perform distributed training you can use either dask, ray or spark. Once you know which framework you want to use you can include its extra:\n",
"\n",
"and also either [LightGBM](https://github.com/microsoft/LightGBM/tree/master/python-package) or [XGBoost](https://xgboost.readthedocs.io/en/latest/install.html#python)."
"* dask: `pip install \"mlforecast[dask]\"`\n",
"* ray: `pip install \"mlforecast[ray]\"`\n",
"* spark: `pip install \"mlforecast[spark]\"`"
]
},
{
Expand Down
Loading