Skip to content

WIP: Update MLTS with a Focus on Forecasting #27

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ notebooks/spark/scripts/
notebooks/exercises/scripts/
TensorBoard/
.vscode/
# ignore lightning_logs folder in whatever directory
lightning_logs/

# Julia
Manifest.toml
/Project.toml
/Project.toml
78 changes: 78 additions & 0 deletions drafts/FTS Seminarablauf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Forecasting auf Zeitreihen - Mit maschinellem Lernen zur Prognose und Entscheidung

Inhalte und Ablauf des Kurses

Tag 1 - Grundlagen und Einführung in Zeitreihenprognosen

1. Start, Begrüßung, Vorstellungsrunde, Erwartungen
- Warum Forecasting auf Zeitreihen?
- Anwendungsbeispiele und Motivation
- Beispieldatensätze (Handel, Ökologie, Mobilität...)

2. Einführung in Zeitreihenprognosen: Grundbegriffe und Konzepte
- Univariate und multivariate Zeitreihen
- Zeitreihenkomponenten (Trend, Saisonalität, Zyklen, Unregelmäßigkeit)
- Direkte und rekursive Prognoseverfahren
- Prognosehorizont

3. Explorative Datenanalyse für Zeitreihen
- Visualisierung und Analyse von Zeitreihendaten
- Identifizierung von Mustern und Anomalien

4. Datenvorverarbeitung und Feature Engineering
- Umgang mit fehlenden Werten und Ausreißern
- Exogene Merkmale (Kalendermerkmale, kategoriale Merkmale)
- Fenstermerkmale und verzögerte Variablen

5. Traditionelle Zeitreihenmodelle und einfache Baseline-Modelle
- Naive Methoden
- traditionelle Modelle (Moving Average etc.)

6. Probabilistische Prognosen: Quantifizierung der Unsicherheit
- Quantifizierung der Unsicherheit in Prognosen
- Generierung von Konfidenzintervallen
- Evaluierungsmetriken für probabilistische Prognosen

Tag 2 - Fortgeschrittene Techniken, aktuelle Frameworks und Praxis

1. Modellevaluierung und Interpretation
- Aufteilung und Kreuzvalidierung
- Evaluierungsmetriken für Zeitreihenprognosen (MAPE, RMSE, MASE)
- Interpretation und Visualisierung von Prognoseergebnissen
- Merkmalswichtigkeit und Erklärbarkeit

2. Klassische Machine Learning-Modelle für Zeitreihenprognosen
- Regressionsmodelle (lineare Regression, Entscheidungsbäume, Random Forests...)

3. State-of-the-Art-Modelle und Pakete
- Deep Learning für Prognosen
- Fortgeschrittene statistische Modelle
- Einführung in aktuelle Pakete
- SKForecast, GluonTS, Chronos, Prophet...

4. Praktische Übung und Challenge: Anwendung von Forecasting auf Beispieldatensätze
- Implementierung und Vergleich
- Evaluierung der Modelle anhand ausgewählter Datensätze
- Diskussion

5. Bereitstellung von Prognosemodellen in der Praxis
- Überlegungen zum Deployment von Modellen
- Überwachung und Aktualisierung von Modellen im Laufe der Zeit (concept drift..)
- Echtzeitprognosen
- Integration in Geschäftsprozesse

6. Kurszusammenfassung und Fragen & Antworten
- Zusammenfassung der behandelten Schlüsselkonzepte und -techniken
- Offene Diskussion und Fragen der Teilnehmer

Übungsmaterial

- Lehrmaterialien, Beispieldatensätze, interaktive Übungen, ...

Eingesetzte Frameworks und Pakete
Python, Pandas, NumPy, Matplotlib, SKForecast, GluonTS, Chronos, Prophet, ...

Eingesetzte Tools im Seminar
In diesem Online-Seminar arbeitest du direkt in einer cloudbasierten Laborumgebung, die vom Trainer bereitgestellt wird. Ein Webbrowser genügt – keine Installation notwendig.
Interaktive Jupyter Notebooks dienen als Lernmaterial und Arbeitsumgebung zugleich. Sie enthalten neben Quellcode auch Dokumentation, Referenzen und Links. Aufgrund des Programmier-Fokus sind die Unterlagen primär auf Englisch.
Deine Online-Lernumgebung hält nach der Anmeldung ergänzende Informationen und Services für dich bereit.
81 changes: 81 additions & 0 deletions drafts/FTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Forecasting on Time Series - Machine Learning for Prediction and Decision-Making"

Day 1:

1. Introduction to Time Series Forecasting
- Importance of forecasting in decision-making
- Example Problems and Datasets
- Dataset 1: "store_sales" (daily sales transactions for 50 products in 10 stores)
- Introducing demand forecasting and inventory management
- Dataset 2: "air_quality_valencia" (hourly measures of air pollutants in Valencia, Spain)
- Discussing environmental monitoring and air quality prediction
- Dataset 3: "bicycle_sharing" (hourly usage of bike share system in Washington, D.C.)
- Exploring forecasting for resource allocation and transportation planning

2. Fundamentals and Basic Terms
- univariate and multivariate time series
- Exploratory data analysis techniques for time series
- time series components (trend, seasonality, cycles, irregularity)
- Direct and recursive forecasting approaches
- forecast horizon



3. Data Preprocessing and Feature Engineering
- Handling missing values and outliers
- Temporal data splitting (train/test)
- Exogenous features (calendar features, categorical features)
- Window features and lagged variables

4. Traditional Time Series Models and Simple Baseline Models
- Naive methods (last value, average)
- Moving average and exponential smoothing

5. Probabilistic Forecasting: Quantifying Uncertainty
- Quantifying uncertainty in forecasts
- Generating confidence intervals
- Evaluation metrics for probabilistic forecasts

Day 2:

1. Model Evaluation and Interpretation
- Split and cross-validation
- Evaluation metrics for time series forecasting (MAPE, RMSE, MASE)
- Interpreting and visualizing forecasting results
- Feature importance and explainability


2. Classical Machine Learning Models for Time Series Forecasting
- Regression models (linear regression, decision trees, random forests..)

3. State-of-the-art Models & Packages
- deep learning for forecasting
- advanced statistical models
- introducing SKForecast, GluonTS, Chronos, Prophet


4. Hands-on Exercise & Challenge: Applying Forecasting Methods to Example Datasets
- Implementing and comparing traditional and machine learning models using SKForecast, Chronos, and GluonTS
- Evaluating models on the selected datasets:
- "store_sales" for demand forecasting
- "air_quality_valencia" for air quality prediction
- "bicycle_sharing" for resource allocation forecasting


5. Deploying Forecasting Models in Production
- Considerations for productionizing forecasting models
- Concept drift
- Monitoring and updating models over time
- Real-time forecasting and integration with business processes

6. Course Recap and Q&A
- Summary of key concepts and techniques covered
- Open discussion and questions from participants




----



21 changes: 21 additions & 0 deletions notebooks/data-science-learning-paths.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,27 @@
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div style=\"display: flex; align-items: start; margin-bottom: 20px; padding: 20px; border-radius: 10px;\">\n",
" <img src=\"images/art-time-series-forecasting.png\" alt=\"Machine Learning on Time Series\" style=\"width: 30%; margin-right: 20px; border-radius: 10px;\">\n",
" <div style=\"width: 65%;\">\n",
" <h2>Time Series Forecasting [TSF]</h2>\n",
" <p>\n",
" A 2-day advanced course on machine learning for prediction and decision-making.\n",
" </p>\n",
" <ul>\n",
" <li><strong>Level:</strong> Advanced</li>\n",
" <li><strong>Duration:</strong> 2 days</li>\n",
" <li><strong>Prerequisites:</strong> DAP</li>\n",
" <li><strong>Index notebook:</strong> <a href=\"index/tsf-time-series-forecasting.ipynb\">📓 Start course</a></li>\n",
" </ul>\n",
" </div>\n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
Binary file added notebooks/images/art-time-series-forecasting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions notebooks/index/mlts-machine-learning-time-series.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
"\n",
"1. **[Time Series Forecasting](../timeseries/mlts-forecasting-intro.ipynb)**<br>\n",
" About predicting a time series several steps into the future.\n",
"\n",
" 1. **[Foreccasting Metrics and Evaluation Techniques](../timeseries/mlts-forecasting-evaluation.ipynb)**<br>\n",
" \n",
" 1. **[Classical Time Series Forecasting Models](../timeseries/mlts-classical-forecasting-models.ipynb)**<br>\n",
" Statistical modelling applied to forecasting.\n",
Expand Down
110 changes: 110 additions & 0 deletions notebooks/index/tsf-time-series-forecasting.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Time Series Forecasting \n",
"**Machine Learning for Prediction and Decision-making**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"An intensive course on how to apply modern machine learning for prediction and decision-making on time series data. \n",
"\n",
"This is an advanced course that builds on practical experience in Python programming, data analysis, and machine learning. While we recapitulate some of the foundations, they are covered in much more detail in the following modules of Data Science Learning Paths:\n",
"\n",
"- [📓 Data Analysis with Python](dap2-data-analysis-python.ipynb)\n",
"- [📓 Machine Learning with Python](mlp2-machine-learning-python-2day.ipynb)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Table of Contents\n",
"\n",
"### Basics\n",
"\n",
"1. **[Handling Time Series with pandas](../python/python-timeseries-pandas.ipynb)**<br>\n",
" Working with time series data as dataframes.\n",
" \n",
"2. **[Time Series Analysis](../timeseries/mlts-time-series-analysis.ipynb)**<br>\n",
" Analysing time series data for structure. \n",
"\n",
"### Forecasting\n",
"\n",
"\n",
"1. **[Time Series Forecasting](../timeseries/mlts-forecasting-intro.ipynb)**<br>\n",
" About predicting a time series several steps into the future.\n",
"\n",
" 1. **[Foreccasting Metrics and Evaluation Techniques](../timeseries/mlts-forecasting-evaluation.ipynb)**<br>\n",
" \n",
" 2. **[Classical Time Series Forecasting Models](../timeseries/mlts-classical-forecasting-models.ipynb)**<br>\n",
" Statistical modelling applied to forecasting.\n",
" \n",
" 3. **[Forecasting with Prophet](../timeseries/mlts-prophet.ipynb)**<br>\n",
" An easy-to-use model from our colleagues at a social media company. \n",
" \n",
" 4. **[Forecasting with Shallow Learning](../timeseries/mlts-forecasting-shallow.ipynb)**<br>\n",
" How to apply any supervised ML regression algorithm for forecasting.\n",
"\n",
" 5. **[Forecasting with Deep Learning](../timeseries/mlts-forecasting-deep.ipynb)**<br>\n",
" Using recurrent neural networks to forecast a time series."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Exercise\n",
"\n",
"1. [**Challenge: Forecasting Taxi Demand**](../timeseries/mlts-challenge.ipynb)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Additional Resources\n",
"\n",
"- [**Python Test Notebook**](../test.ipynb)<br>\n",
" Verify that your Python stack is working.\n",
" \n",
"- [**Jupyter Cheat Sheet**](../jupyter/cheatsheet.ipynb)<br>\n",
" Some useful commands for Jupyter Notebook, mostly optional."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"_This notebook is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/). Copyright © 2018-2024 [Point 8 GmbH](https://point-8.de)_"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.0"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading