Bike-Sharing Demand Forecasting Using Machine Learning
This case study presents the implementation of a machine learning (ML)-based short-term demand forecasting system for the public bike-sharing network in Valladolid, Spain, developed within the EU-funded SPINE project. The primary objective is to improve the operational management of the city’s bike-sharing service by accurately predicting bicycle demand at the station level, enabling operators to proactively address imbalances in bicycle availability and docking capacity.
The Valladolid bike-sharing system comprises 97 stations distributed across the city. The forecasting framework was trained using anonymized historical station-to-station trip data collected during 2023 and 2024. Trip records were aggregated into hourly intervals, producing two key variables for each station: FlowIN (arriving bicycles) and FlowOUT (departing bicycles). The resulting dataset contained over 1.6 million observations, providing a comprehensive representation of temporal and spatial demand patterns across the network.
The proposed workflow consists of three main stages. First, an automated data-cleaning process removes anomalies, imputes missing values, and standardizes the time series. Second, an unsupervised learning module clusters days with similar mobility patterns, identifying representative daily demand profiles. Finally, a supervised forecasting model combines historical observations with the identified demand patterns to predict FlowIN and FlowOUT up to 60 minutes ahead for every station. The forecasting outputs are integrated into an operational dashboard that provides intuitive visualizations and reliability indicators, allowing operators to monitor expected demand in near real time without interacting directly with the underlying ML models.
Location: Valladolid, Spain
Start/End dates: 2023/2024
The produced impact
The results demonstrate that the proposed approach accurately captures network-wide demand dynamics, including morning and afternoon peak periods. The forecasting model achieved average RMSE values of 0.78 for FlowIN and 0.77 for FlowOUT, indicating strong predictive performance for short-term operational planning. Beyond demand prediction, the framework is designed to support future simulation-based evaluation of bicycle rebalancing strategies, forming the basis of a Shared Mobility Digital Twin capable of improving fleet management, reducing operational costs, and increasing service reliability and user satisfaction.
Key lessons learnt
The case study highlights several key lessons for deploying AI in bike-sharing operations. First, successful short-term demand forecasting depends on a robust end-to-end workflow, with elements such as automated data cleaning, standardisation, and quality checks being essential for reliable real-time forecasts. Second, combining unsupervised pattern discovery with supervised machine learning improves the ability to capture recurring demand behaviours and predict station-level demand up to 60 minutes ahead. Third, operational impact requires accessible visualisation tools: integrating forecasts into user-friendly dashboards enables operators to make timely rebalancing decisions without ML expertise. Finally, the framework was designed to be transferable to other cities, provided that historical trip data, network information, and data exchange mechanisms are available. The authors also identify the integration of forecasting with simulation-based fleet rebalancing as the next step toward proactive, data-driven bike-sharing management.
The resource is available in Spanish.
Reference Description
The case study presented here was first published on 20/10/2025.
If you are interested in learning more about this case study, you can contact the SPINE Project at info@spine-project.eu.
Find more information about the SPINE Project here.
- Related Resource
