Skip to content
Marwan Abouzeid
← cd ../projects

toronto-bikeshare-ml

Demand-forecasting pipeline over ~19.2M trips and 878 stations — a PyTorch GRU forecaster served through a FastAPI + React app with an interactive map.

Source ↗ Live demo ↗ ML & Systems · 2025
  • PyTorch
  • Python
  • FastAPI
  • React
  • Vite
  • Leaflet
  • Docker
  • Hugging Face

toronto-bikeshare-ml is a full-stack machine learning application that forecasts daily ridership demand across the Toronto Bikeshare network. A Gated Recurrent Unit (GRU) model analyzes historical trip data to predict station activity for the next 24 hours, surfacing urban-mobility patterns on an interactive map.

The data and model

  • ~19.2 million historical trips mined and aggregated across 878 active stations.
  • Engineered temporal features and station embeddings to capture both seasonality and per-station behavior.
  • Trained a PyTorch GRU forecaster, evaluated on a 30-day holdout: MAE 6.91 and RMSE 12.10, with over 75% of predictions within ~9 trips of the actual count.
  • Per-station error diagnostics expose where the model is strong and where it struggles, rather than hiding behind a single aggregate score.

System architecture

  1. Data ingestion — aggregates historical ridership and station status.
  2. Inference engine — the PyTorch GRU processes time-series input to produce per-station demand forecasts.
  3. API layer — a FastAPI backend serves predictions and manages data flow.
  4. Visualization — a React/Vite front end renders a Leaflet map with color-coded demand and capacity indicators, plus Recharts time series.

Deployment

Containerized with Docker and deployed to Hugging Face Spaces, where a live demo runs the trained model end to end.