Skip to content
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
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# littlebooktimeseries

Timeseries in 3 hours

## Environment setup

Choose one of the options below to get the workshop notebooks ready.

### Poetry
- Install Poetry: `curl -sSL https://install.python-poetry.org | python3 -`
- Install dependencies: `poetry install`
- Start the shell: `poetry shell`
- Launch Jupyter: `jupyter lab`

### pip
- Create a virtual environment: `python3 -m venv .venv`
- Activate it: `source .venv/bin/activate`
- Install dependencies: `pip install -r requirements.txt`
- Launch Jupyter: `jupyter lab`

### uv
- Install uv: `pip install uv`
- Sync dependencies: `uv sync`
- Activate the environment: `source .venv/bin/activate`
- Launch Jupyter: `jupyter lab`

> All options require Python 3.11 or 3.12. The notebooks live under `notebooks/`; open them in Jupyter Lab during the session.
4 changes: 2 additions & 2 deletions book/content/pt/part2/hierarchical_forecasting.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ from tsbook.forecasting.reduction import ReductionForecaster
from lightgbm import LGBMRegressor

forecaster = ReductionForecaster(
LGBMRegressor(n_estimators=50, verbose=-1, objective="tweedie"),
LGBMRegressor(n_estimators=100, verbose=-1, objective="tweedie", random_state=42),
window_length=30,
normalization_strategy="divide_mean",
)
Expand Down Expand Up @@ -296,7 +296,7 @@ pd.DataFrame(
"OptimalReconciler (ols)": metric(y_test, y_pred_optimal, y_train=y_train),
"Mint Reconciler": metric(y_test, y_pred_mint, y_train=y_train),
},
index=["Mean Absolute Scaled Error"],
index=["Mean Absolute Squared Error"],
)
```

6 changes: 3 additions & 3 deletions book/content/pt/part2/ml_models.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ Primeiro, vamos import `ReductionForecaster`, que é a classe que implementa a a

```{python}
from tsbook.forecasting.reduction import ReductionForecaster
from sklearn.ensemble import RandomForestRegressor
from lightgbm import LGBMRegressor

model = ReductionForecaster(
RandomForestRegressor(n_estimators=100, random_state=42),
LGBMRegressor(n_estimators=100, random_state=42),
window_length=30,
)

Expand All @@ -135,7 +135,7 @@ Uma solução é usar a diferenciação para remover a tendência da série.
```{python}
from sktime.transformations.series.difference import Differencer

regressor = RandomForestRegressor(n_estimators=100, random_state=42)
regressor = LGBMRegressor(n_estimators=100, random_state=42)

model = Differencer() * ReductionForecaster(
regressor,
Expand Down
5 changes: 2 additions & 3 deletions book/content/pt/part2/panel_data.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ from tsbook.forecasting.reduction import ReductionForecaster
from lightgbm import LGBMRegressor

global_forecaster1 = ReductionForecaster(
LGBMRegressor(n_estimators=100, verbose=-1),
LGBMRegressor(n_estimators=100, verbose=-1, random_state=42),
window_length=30,
)

Expand Down Expand Up @@ -219,7 +219,6 @@ Sabemos como preprocessar séries temporais univariadas para melhorar o desempen
```{python}
from sktime.transformations.series.difference import Differencer


global_forecaster2 = Differencer() * global_forecaster1
global_forecaster2.fit(y_train, X_train)
```
Expand Down Expand Up @@ -249,7 +248,7 @@ errors["Local (2)"] = metric_local2
errors
```

Note como já superamos o modelo global incial, e o modelo local. Isso é para
Note como já superamos o modelo global incial. Isso é para
destacar que é **essencial** realizar um bom preprocessamento e engenharia de features para que modelos de Machine Learning tenham bom desempenho em dados em painel.

### Normalização por janela
Expand Down
Binary file not shown.
4,422 changes: 0 additions & 4,422 deletions book/latest/content/pt/extra/sktime_custom.html

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file removed book/latest/content/pt/part1/balls1.png
Binary file not shown.
2,761 changes: 0 additions & 2,761 deletions book/latest/content/pt/part1/components_and_diff.html

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading