CONFIDENTIAL · DATA SCIENCE REPORT · 2018
Case Study — Business Analysis Report

Predicting Bicycle Demand for BIXI Montréal

A data-driven analysis of 2018 ridership patterns combining origin-destination records and hourly weather data to build accurate, actionable demand prediction models.

869,820 trips analysed
Linear Regression & Decision Tree
Apr, Oct & Nov 2018
Hourly weather integration
Photos: Wikimedia Commons · CC BY-SA 3.0
BIXI Montreal station
BIXI station · Montréal
BIXI René-Lévesque & Beaudry
René-Lévesque & Beaudry
Premier trajet BIXI
Premier trajet BIXI · 2009
01

Key findings at a glance

Total trips analysed
869,820
3 months of OD records
Member ridership
89.8%
vs 10.2% casual riders
Decision Tree R²
0.83
83% variance explained
Peak hour demand
98,951
trips at 17:00 (Oct)

"Demand for BIXI bicycles is strongly governed by two predictable forces: commuting rhythms on weekdays and afternoon leisure on weekends. Adding temperature as a variable brings prediction accuracy to R² = 0.83, enabling proactive rebalancing and staffing decisions."

— Nataliya Abboud, Data Science Consultant
Problem

Demand fluctuations — hourly, weekday vs weekend, and weather-driven — make station rebalancing and bicycle availability planning extremely difficult for BIXI's operations team.

Solution

Merged hourly weather records with aggregated BIXI trip data. Engineered time features and built two ML models. Decision Tree selected as the preferred model based on lower RMSE and higher R².

Best model
DT
Decision Tree · RMSE ≈ 407 · R² ≈ 0.83
Primary KPI
Rides/hr
Target variable: total rides commencing within each calendar hour across all active stations.
02

Why demand prediction matters for BIXI

BIXI Montréal operates one of North America's largest public bike-sharing networks. Accurate demand prediction is critical for three operational priorities: reducing bicycle shortages at peak hours, improving station rebalancing efficiency, and optimising operational costs across the network.

BIXI's management identified two distinct demand patterns — weekday and weekend — and believed weather to be a significant driver. This project validates both hypotheses with data and delivers actionable ML-based forecasting.

Challenge 1
Peak-hour shortages
Empty docks and missing bikes during 8am and 5pm commute surges cost BIXI in user satisfaction.
Challenge 2
Inefficient rebalancing
Trucks redistributing bikes without demand forecasts waste fuel and labour, often rebalancing too late.
Challenge 3
Weather uncertainty
Cold snaps and rain dramatically suppress ridership, but without a model, staff changes are reactive.
03

From raw records to predictive features

Dataset 1 — BIXI Trip Records
SourceBIXI Montréal OD Files
MonthsApril, October, November 2018
Total records869,820 trips
Key fieldsstart_date, station codes, duration, member flag
Dataset 2 — Montreal Weather
SourceGovernment of Canada
StationMcTavish Reservoir (McGill)
FrequencyHourly observations · 5,806 rows
Key fieldsTemp (°C), dew point, wind speed
1
Load & concatenate trip files
Combined OD CSV files for all available months into a single dataframe. Removed null records to ensure clean aggregation.
2
Feature engineering
Derived hour of day, date, and is_weekend boolean from the start_date timestamp to capture temporal demand patterns.
3
Aggregate to hourly demand
Counted rides per (date × hour) group to create the target variable — trips — matching the granularity of weather observations.
4
Merge weather data
Joined on shared date and hour keys. Dropped rows with missing temperature values to maintain data integrity for modeling.
5
Train / test split & model training
80/20 random split (seed=42). Trained Linear Regression and Decision Tree (max_depth=5) on identical features: hour, is_weekend, Temp (°C).
04

Demand patterns & weather correlation

Hourly trip volume — all days combined
Total trips per hour across April, October & November 2018
Trip volume
Finding: Two clear demand peaks emerge — a morning commute spike at 08:00 (77k trips) and a stronger evening peak at 17:00 (98,951 trips). Night hours (00:00–05:00) see dramatically suppressed demand, enabling maintenance scheduling.
Weekday vs weekend pattern
Average rides per hour by day type
Weekday
Weekend
Weekdays show a sharp dual-peak commuter pattern. Weekends display a single, flatter leisure peak around 14:00–16:00.
Monthly ridership
Total trips by available month
October 2018 recorded the highest ridership (488,490), likely due to warm early-fall weather. November's rapid drop aligns with temperatures averaging −0.2°C.
Temperature vs monthly ridership — seasonal relationship
Average temperature (°C) and available monthly ridership across 2018
Avg Temp (°C)
Ridership (available months)
Finding: Temperature and ridership move in close alignment. The correlation confirms BIXI's management hypothesis — warmer days yield significantly more rides, providing a reliable weather-based planning signal.
05

Model comparison & selection

Two supervised learning models were trained on the merged dataset using features hour, is_weekend, and Temp (°C) to predict hourly trip counts. An 80/20 train-test split was applied with random seed 42.

Model performance summary
Model RMSE RMSE vs best Status
Decision Tree
max_depth = 5
≈ 407 0.83
55%
Selected model
Linear Regression
Ordinary least squares
≈ 740 0.44
100%
Baseline
RMSE comparison
Lower is better
R² comparison
Higher is better

"The Decision Tree model captures non-linear relationships — demand does not scale linearly with temperature or hour. At 24°C versus 20°C, the marginal lift in ridership is greater than at 5°C versus 1°C. This threshold behaviour is what Linear Regression misses and Decision Tree captures."

— Model evaluation rationale
06

Operational & strategic actions for BIXI

01
Commute-hour pre-positioning
Increase bicycle availability and docking capacity at major stations before the 07:30 and 16:30 windows on weekdays. Decision Tree forecasts an average of 77k+ trips at 08:00 — staffing rebalancing trucks before these windows reduces shortages.
Trigger: Weekday 07:30 & 16:30 windows
02
Temperature-responsive staffing
Assign additional rebalancing staff on days forecast above 20°C. The model shows strong demand uplift with temperature; warm days (+20°C) drive significantly more trips than cool days (~7°C, as seen in October).
Threshold: Temp ≥ 20°C → elevated staffing
03
Weekend midday rebalancing
Shift weekend operations from a morning-focused schedule to a midday window (12:00–16:00). Weekend patterns show leisure-driven afternoon peaks rather than commute spikes, meaning early morning rebalancing is wasted effort.
Weekend peak: 14:00–16:00
04
Deploy Decision Tree for forecasting
Adopt the Decision Tree model (RMSE ≈ 407, R² = 0.83) as BIXI's short-term demand forecasting engine. Integrate next-day temperature forecasts and day-of-week flags to generate hourly demand predictions for each station cluster.
Model accuracy: R² = 0.83
Data sources
BIXI Montréal (2018)
BIXI trip data — origin-destination records for April, October and November 2018.
Environment Canada (2018)
Historical hourly weather data — McTavish Reservoir station, Montréal.
McGill School of Continuing Studies
Case study instructions and analytical framework.
Analysis tools
Python (pandas, scikit-learn, matplotlib, seaborn) · Alteryx · Tableau