An automated MLOps pipeline that predicts parking spot availability in Donostia, Spain using time series forecasting. The system continuously collects real-time parking data via GitHub Actions and trains machine learning models to predict availability up to 48 hours in advance.
This project demonstrates a complete MLOps workflow for time series forecasting. It automatically extracts parking availability data from the Donostia municipal API every hour, stores historical records, and trains forecasting models using Random Forest regressors optimized through grid search.
The pipeline addresses a real-world problem: available parking spots aren't tracked historically by the city, making predictive modeling impossible without building a data collection system first.
Key Features:
- Automated data extraction with GitHub Actions (runs hourly)
- Time series forecasting using
skforecastlibrary - Hyperparameter optimization via grid search
- Modular, production-ready code structure
- Comprehensive logging and error handling
┌─────────────────┐
│ Donostia API │ ← Real-time parking data
└────────┬────────┘
│
▼
┌─────────────────────┐
│ GitHub Actions │ ← Runs every hour
│ (Data Extraction) │
└────────┬────────────┘
│
▼
┌─────────────────────┐
│ data/data.csv │ ← Historical dataset
└────────┬────────────┘
│
▼
┌─────────────────────┐
│ Training Pipeline │ ← Grid search + validation
└────────┬────────────┘
│
▼
┌─────────────────────┐
│ models/model.pkl │ ← Trained forecaster
└─────────────────────┘
- Python 3.9+
- Git
# Clone the repository
git clone https://github.com/yourusername/parking-forecasting-mlops.git
cd parking-forecasting-mlops
# Install dependencies
pip install -r requirements.txt
# Set up configuration
cp config/.env.example .envExtract Parking Data:
python scripts/extract_data.pyTrain Forecasting Model:
python src/train.pyAutomated Data Collection:
The GitHub Actions workflow automatically runs extract_data.py every hour. To set up:
- Create a GitHub Personal Access Token with
repopermissions - Add it as a repository secret named
GH_TOKEN - Update the repository URL in
.github/workflows/update_data.yml
parking-forecasting-mlops/
├── .github/
│ └── workflows/
│ └── update_data.yml # Automated data extraction workflow
├── config/
│ └── .env.example # Configuration template
├── data/
│ └── data.csv # Historical parking data
├── docs/
│ └── ARCHITECTURE.md # Detailed architecture documentation
├── models/ # Trained models directory
├── scripts/
│ ├── extract_data.py # API data extraction script
│ └── update_data.sh # Git push automation
├── src/
│ ├── __init__.py
│ ├── config.py # Centralized configuration
│ └── train.py # Model training pipeline
├── .gitignore
├── LICENSE
├── README.md
└── requirements.txt
Edit .env or set environment variables:
PARKING_NAME: Target parking lot name (default: "Boulevard")PREDICTION_STEPS: Forecast horizon in hours (default: 48)
Model hyperparameters can be adjusted in src/config.py.
- Algorithm: Random Forest Regressor with Autoregressive features
- Framework: skforecast (specialized for time series forecasting)
- Optimization: Grid search over lag configurations and RF hyperparameters
- Validation: Time-based train-test split with forward chaining
Hyperparameters Tuned:
- Number of estimators: [100, 500]
- Max depth: [3, 5, 10]
- Lag configurations: [24, 48, 72 hours]
Parking availability data is sourced from the Donostia City Council's open API:
- Endpoint:
https://www.donostia.eus/info/ciudadano/camaras_trafico.nsf/getParkings.xsp - Update Frequency: Real-time
- Coverage: All municipal parking facilities in Donostia/San Sebastián
This project is licensed under the MIT License - see the LICENSE file for details.
Sebastian Salazar
- Email: ssalazaro1@eafit.edu.co
- GitHub: @Sebasalazaro
Developed as part of the Intensive Systems course at Universidad EAFIT (2025)
-
Crear su propio repo ‘mlops-ejemplo2.git’ en su cuenta github y seguir trabajando en este para todos los cambios.
-
Realizar los ajustes respectivos en su propio código, cada vez haga ‘git push’
-
Revisar la ejecución de las acciones github
-
Actualizar el repositorio local para verificar cambios en los datos y buen funcionamiento del crarler y automatización:
LOCAL: git pull
-
documente todas las anteriores actividades
-
entregar el lab