Skip to content

Commit a3436fb

Browse files
deven367nasaul
andauthored
Fix more broken links (#1040)
Co-authored-by: Saul <saul.caballero.ramirez@gmail.com>
1 parent 8ed1bc6 commit a3436fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+481309
-481324
lines changed

.github/workflows/build-docs.yaml

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ on:
44
branches: [main]
55
pull_request:
66
branches: [main]
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
inputs:
11+
environment:
12+
description: "The environment to deploy to"
13+
required: true
14+
type: choice
15+
default: "staging"
16+
options:
17+
- staging
18+
- production
719

820
jobs:
921
build-docs:
@@ -15,11 +27,10 @@ jobs:
1527

1628
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1729
with:
18-
python-version: '3.10'
30+
python-version: "3.10"
1931

2032
- name: Install dependencies
21-
run: |
22-
pip install -e '.[all]' lazydocs pyyaml
33+
run: pip install -e '.[all]' lazydocs pyyaml
2334

2435
# setup quarto for rendering example/tutorial nbs
2536
- uses: quarto-dev/quarto-actions/setup@v2
@@ -29,8 +40,18 @@ jobs:
2940
- name: Build Docs
3041
run: make all_docs
3142

32-
- name: Deploy
33-
if: github.event_name == 'push'
43+
- name: Deploy (Push to main or Pull Request)
44+
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'staging')
45+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
46+
with:
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
publish_branch: docs-preview
49+
publish_dir: docs/mintlify
50+
user_name: github-actions[bot]
51+
user_email: 41898282+github-actions[bot]@users.noreply.github.com
52+
53+
- name: Deploy (Release)
54+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'production')
3455
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
3556
with:
3657
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -39,8 +60,21 @@ jobs:
3960
user_name: github-actions[bot]
4061
user_email: 41898282+github-actions[bot]@users.noreply.github.com
4162

42-
- name: Trigger mintlify workflow
43-
if: github.event_name == 'push'
63+
- name: Trigger mintlify workflow (Push to main or Pull Request)
64+
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'staging')
65+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
66+
with:
67+
github-token: ${{ secrets.DOCS_WORKFLOW_TOKEN }}
68+
script: |
69+
await github.rest.actions.createWorkflowDispatch({
70+
owner: 'nixtla',
71+
repo: 'docs',
72+
workflow_id: 'mintlify-action-preview.yml',
73+
ref: 'main',
74+
});
75+
76+
- name: Trigger mintlify workflow (Release)
77+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'production')
4478
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
4579
with:
4680
github-token: ${{ secrets.DOCS_WORKFLOW_TOKEN }}

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@ Finally to view the documentation
129129
make preview_docs
130130
```
131131

132+
- The docs are automatically generated from the docstrings in the `python/statsforecast` folder.
133+
- To contribute, ensure your docstrings follow the Google style format.
134+
- Once your docstring is correctly written, the documentation framework will scrape it and regenerate the corresponding `.mdx` files and your changes will then appear in the updated docs.
135+
- Make an appropriate entry in the `docs/mintlify/mint.json` file.
136+
- Run `make all_docs` to regenerate the documentation.
137+
- Run `make preview_docs` to view and test the documentation locally.
138+
132139
## Start Coding
133140

134141
Open a jupyter notebook using `jupyter lab` (or VS Code).

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ api_docs:
3737
examples_docs:
3838
mkdir -p nbs/_extensions
3939
cp -r docs-scripts/mintlify/ nbs/_extensions/mintlify
40-
python docs-scripts/update-quarto.py
4140
quarto render nbs/docs --output-dir ../docs/mintlify/
4241
quarto render nbs/src --output-dir ../docs/mintlify/
4342
quarto render nbs/blog --output-dir ../docs/mintlify/

README.md

Lines changed: 60 additions & 54 deletions
Large diffs are not rendered by default.

docs/mintlify/dark.png

2.82 KB
Loading

docs/mintlify/light.png

2.78 KB
Loading

docs/to_mdx.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@
2121
---
2222
"""
2323
readme_text = Path("README.md").read_text()
24+
# replace url with .
25+
readme_text = re.sub(r"https?://nixtlaverse\.nixtla\.io/", "./", readme_text)
2426
readme_text = header + readme_text
2527
(output_path / "index.mdx").write_text(readme_text)

experiments/amazon_forecast/README.md

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
11
## Amazon's AutoML vs open source statistical methods
2-
>TL;DR: We paid USD $800 USD and spend 4 hours in the AWS Forecast console so you don't have to.
2+
>
3+
>TL;DR: We paid USD $800 USD and spend 4 hours in the AWS Forecast console so you don't have to.
34
4-
In this reproducible experiment, we compare [Amazon Forecast](https://aws.amazon.com/forecast/) and [StatsForecast](https://github.com/Nixtla/statsforecast) a python open-source library. For this experiment, given the prominent use of AWS Forecast in demand forecasting, we used the 30,490 series of daily sales at Walmart from the [M5 competition](https://mofc.unic.ac.cy/m5-competition/). We conclude that, for this setting, Amazon Forecast is 60% less accurate and 669 times more expensive than running an open-source alternative in a simple cloud server.
5-
6-
We also provide a step-by-step guide to [reproduce the results](https://nixtla.github.io/statsforecast/examples/aws/statsforecast.html).
5+
In this reproducible experiment, we compare [Amazon Forecast](https://aws.amazon.com/forecast/) and [StatsForecast](https://github.com/Nixtla/statsforecast) a python open-source library. For this experiment, given the prominent use of AWS Forecast in demand forecasting, we used the 30,490 series of daily sales at Walmart from the [M5 competition](https://mofc.unic.ac.cy/m5-competition/). We conclude that, for this setting, Amazon Forecast is 60% less accurate and 669 times more expensive than running an open-source alternative in a simple cloud server.
76

7+
We also provide a step-by-step guide to [reproduce the results](https://nixtlaverse.nixtla.io/statsforecast/docs/experiments/AmazonStatsForecast)
88

99
### Amazon Forecast
10-
Amazon Forecast is an AutoML time-series forecasting service.
10+
11+
Amazon Forecast is an AutoML time-series forecasting service.
1112

1213
> It uses machine learning (ML) to generate more accurate demand forecasts with just a few clicks, without requiring any prior ML experience. Amazon Forecast includes algorithms that are based on over twenty years of forecasting experience and developed expertise used by Amazon.com bringing the same technology used at Amazon to developers as a fully managed service, removing the need to manage resources. Amazon Forecast uses ML to learn not only the best algorithm for each item, but the best ensemble of algorithms for each item, automatically creating the best model for your data.
1314
1415
Amazon Forecast is one of the leading forecasting services out there. You can read more about its features and pricing tiers [here](https://aws.amazon.com/forecast/).
1516

16-
Amazon Forecast creates predictors with AutoPredictor, which involves applying the optimal combination of algorithms to each time series in your datasets. The predictor is an Amazon Forecast model that is trained using your target time series, related time series, item metadata, and any additional datasets you include.
17+
Amazon Forecast creates predictors with AutoPredictor, which involves applying the optimal combination of algorithms to each time series in your datasets. The predictor is an Amazon Forecast model that is trained using your target time series, related time series, item metadata, and any additional datasets you include.
1718

1819
Included algorithms range from commonly used statistical algorithms like Autoregressive Integrated Moving Average (ARIMA), to complex neural network algorithms like CNN-QR and DeepAR+.: CNN-QR, DeepAR+, Prophet, NPTS, ARIMA, and ETS.
1920

20-
2121
### StatsForecast
2222

2323
StatsForecast is an open-source python library from Nixtla. The library offers a collection of widely used univariate time series forecasting models, including automatic ARIMA, ETS, CES, and Theta modeling optimized for high performance using numba. It also includes a large battery of benchmarking models.
2424

25-
For this experiment, we used a `c5d.24xlarge` EC2 instance and trained two simple statistical models: `AutoETS`, and `DynamicOptimizedTheta`. Finally, the `AutoETS` and `DynamicOptimizedTheta` models were ensembled using the median.
26-
25+
For this experiment, we used a `c5d.24xlarge` EC2 instance and trained two simple statistical models: `AutoETS`, and `DynamicOptimizedTheta`. Finally, the `AutoETS` and `DynamicOptimizedTheta` models were ensembled using the median.
2726

2827
### Main Results
2928

30-
Amazon Forecast:
29+
Amazon Forecast:
3130

32-
* achieved 1.617 in error (measured in wRMSSE, the official evaluation metric used in the competition),
31+
* achieved 1.617 in error (measured in wRMSSE, the official evaluation metric used in the competition),
3332
* took 4.1 hours to run,
34-
* and cost 803.53 USD.
33+
* and cost 803.53 USD.
3534

3635
Statsforecast with a simple ensemble of statistical methods trained on a `c5d.24xlarge` EC2 instance:
37-
* achieved 0.669 in error (wRMSSE),
36+
37+
* achieved 0.669 in error (wRMSSE),
3838
* took 14.5 minutes to run,
39-
* and cost only 1.2 USD.
39+
* and cost only 1.2 USD.
4040

41-
For this data set, we show therefore that:
41+
For this data set, we show therefore that:
4242

43-
* Amazon Forecast is 60% less accurate and 669 times more expensive than running an open-source alternative in a simple cloud server.
44-
* Machine Learning methods are outperformed by classical methods in terms of speed, accuracy and cost.
43+
* Amazon Forecast is 60% less accurate and 669 times more expensive than running an open-source alternative in a simple cloud server.
44+
* Machine Learning methods are outperformed by classical methods in terms of speed, accuracy and cost.
4545

4646
Although using StatsForecast requires some basic knowledge of Python and cloud computing, the results are simply better for this dataset.
4747

4848
## Data
4949

5050
We provide open access to the data in the following URLs:
5151

52-
- Train set:
52+
* Train set:
5353
`https://m5-benchmarks.s3.amazonaws.com/data/train/target.parquet`
54-
- Temporal exogenous variables (used by AmazonForecast):
54+
* Temporal exogenous variables (used by AmazonForecast):
5555
`https://m5-benchmarks.s3.amazonaws.com/data/train/temporal.parquet`
56-
- Static exogenous variables (used by AmazonForecast):
56+
* Static exogenous variables (used by AmazonForecast):
5757
`https://m5-benchmarks.s3.amazonaws.com/data/train/static.parquet`
58-
59-
The train set contains `30,490` time series. The M5 competition is hierarchical. That is, forecasts are required for different levels of aggregation: national, state, store, etc.
58+
59+
The train set contains `30,490` time series. The M5 competition is hierarchical. That is, forecasts are required for different levels of aggregation: national, state, store, etc.
6060

6161
## Experiment
6262

@@ -72,7 +72,6 @@ Where the `RMSSE` is defined by,
7272

7373
The `wRMSSE` is the official metric used in the M5 competition.
7474

75-
7675
Detailed results per dataset are shown below.
7776

7877
## Results
@@ -89,15 +88,15 @@ The following table shows the performance across all levels of the hierarchy:
8988

9089
### Time
9190

92-
Excluding time spent in the console and just accounting for processing and computing time, Amazon Forecast took 4.1 hours to run. In comparison, StatsForecast took just 15 minutes to run. Running time accounts for the end-to-end pipeline including loading data, training and forecasting.
91+
Excluding time spent in the console and just accounting for processing and computing time, Amazon Forecast took 4.1 hours to run. In comparison, StatsForecast took just 15 minutes to run. Running time accounts for the end-to-end pipeline including loading data, training and forecasting.
9392

94-
### Cost
93+
### Cost
9594

96-
Amazon included a cost calculator that is quite accurate. The estimated cost was 803.53 USD.
95+
Amazon included a cost calculator that is quite accurate. The estimated cost was 803.53 USD.
9796

9897
In comparison, we paid 1.2 USD of EC2 associated costs. (This could have been further reduced by using spot instances.)
9998

100-
Below, you can find the detailed results.
99+
Below, you can find the detailed results.
101100

102101
**Speed and Cost on M5 Data set**
103102

@@ -115,6 +114,7 @@ This conclusion might or not hold in other datasets, however, given the a priori
115114
Although this experiment does not focus on comparing machine learning and deep learning vs statistical methods, it supports our [previous conclusions](https://github.com/Nixtla/statsforecast/tree/main/experiments/m3) on the current validity of simpler methods for many forecasting tasks.
116115

117116
## Unsolicited Advice
117+
118118
Choose your models wisely.
119119

120120
It would be extremely expensive and borderline irresponsible to favor AutoML in an organization before establishing solid baselines.
@@ -124,4 +124,5 @@ Simpler is sometimes better. Not everything that glows is gold.
124124
Go and try other great open-source libraries like GluonTS, Darts and Sktime.
125125

126126
## Reproducibility
127-
You can fully reproduce the experiment by following [this step-by-step notebook](https://nixtla.github.io/statsforecast/examples/aws/statsforecast.html).
127+
128+
You can fully reproduce the experiment by following [this step-by-step notebook](https://nixtlaverse.nixtla.io/statsforecast/docs/experiments/AmazonStatsForecast).

experiments/ces/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ We are excited to release the only implementation for Python of the Complex Expo
55
![](cspweights.png)
66

77
The CES model has two main advantages over conventional exponential smoothing models:
8+
89
* it can model and forecast both stationary and non-stationary processes and
910
* it can capture both level and trend cases
1011

11-
Our implementation, optimized using numba, was tested on the M4 dataset (100k time series), getting similar accuracy and computational time results than the original implementation in R.
12+
Our implementation, optimized using numba, was tested on the M4 dataset (100k time series), getting similar accuracy and computational time results than the original implementation in R.
1213

1314
Additionally, with StatsForecast you can easly build ensembles of all statstical models. In this experiment, we show how the ensemble between ETS and CES gives the best results.
1415

@@ -26,19 +27,17 @@ Additionally, with StatsForecast you can easly build ensembles of all statstical
2627

2728
## References
2829

29-
* Check the StatsForecast [documentation](https://nixtla.github.io/statsforecast/models.html#autoces) on the CES
30+
* Check the StatsForecast [documentation](https://nixtlaverse.nixtla.io/statsforecast/models#class-autoces) on the CES
3031
* [Link](https://forecasting.svetunkov.ru/wp-content/uploads/2022/07/Svetunkov-et-al.-2022-Complex-Exponential-Smoothing.pdf) to the original paper
3132
* [Link](https://forecasting.svetunkov.ru/en/2022/08/02/the-long-and-winding-road-the-story-of-complex-exponential-smoothing/) to the story of the paper
3233

33-
34-
3534
## Reproducibility
3635

3736
To reproduce the main results you have:
3837

39-
1. Execute `make init`.
38+
1. Execute `make init`.
4039
2. Activate the environment using `conda activate ces`.
4140
3. Run the experiments using `python -m src.ces --dataset M4 --group [group]` where `[model]` can be `[group]` can be `Hourly`, `Daily`, `Weekly`, `Monthly`, `Quarterly`, and `Yearly`.
4241
4. Compute the ensemble model using `python -m src.ensemble --dataset M4 --group [group]` where `[model]` can be `[group]` can be `Hourly`, `Daily`, `Weekly`, `Monthly`, `Quarterly`, and `Yearly`.
43-
4. To run R experiments you have to prepare the data using `python -m src.data --dataset M4 --group [group]` for each `[group]`. Once it is done, just run `make run_module module="Rscript src/ces_r.R [group]"`.
44-
5. Finally you can evaluate the forecasts using `make run_module module="python -m src.evaluation"`.
42+
5. To run R experiments you have to prepare the data using `python -m src.data --dataset M4 --group [group]` for each `[group]`. Once it is done, just run `make run_module module="Rscript src/ces_r.R [group]"`.
43+
6. Finally you can evaluate the forecasts using `make run_module module="python -m src.evaluation"`.

0 commit comments

Comments
 (0)