Hourly bike rental forecast using the weather

Case study on a public dataset from Washington, DC, United States · Updated

We forecast hourly bike rentals 7 days (168 hours) ahead from a public dataset. In testing on past data, the selected method (the 4castPlannr Engine with extra inputs) was off by 26% of actual volume on average, 59% less error than repeating the same hour the day before.

The request

"Forecast hourly bike rentals for the next 7 days using the weather forecast, split by casual vs. registered riders, so we know where to rebalance and when to schedule maintenance."

The request, written the way a business owner would ask it.

The forecast

We expect about 34,856 bike rentals over the next 168 hours, about 207 per hour on average.

Line chart of hourly bike rentals: the actual history, the forecast for the next 7 days (168 hours) with its 80% range, and what actually happened in those days.
The forecast for the next 7 days (168 hours), with the range it expects 8 times out of 10. The dotted line is what really happened.

How accurate was it?

We hid the most recent stretch of history, forecast it using only what came before, and compared with what really happened. We did that 5 times, each time 7 days (168 hours) ahead, for every method below. "Off by" means: add up how far each forecast missed, and divide by the total of what really happened.

The selected method, the 4castPlannr Engine, also given temperature, feels-like temperature, humidity, wind speed, weather conditions, holidays and working days as extra inputs, was typically off by about 26%. That is 59% closer than simply repeating the same hour the day before, which was off by about 63%.

How far off each method typically was in testing, lower is better
MethodKindTypically off byActual inside 80% range
4castPlannr Engine with extra inputs Selected4castPlannr Engine26%72%
4castPlannr Engine4castPlannr Engine33.4%72%
Exponential smoothingClassic44.5%53%
Theta methodClassic47.3%100%
Repeat last seasonSimple rule62.7%88%
Repeat the last valueSimple rule82.9%100%
Line chart comparing past forecasts with actual bike rentals over 5 test runs of 7 days (168 hours) each, made using only the data available at the time.
Back-testing: 5 times we hid the next 7 days (168 hours), forecast them, and compared with what happened.
Bar chart of the typical error of each forecasting method in testing. The selected method had 26% error; repeating the same hour the day before had 62.7%.
Typical error of each method in testing, as a share of actual volume. Lower is better.

Reality check on data no model saw

Before running anything, we set aside the final 168 hours of the data (from 2012-12-02). Nothing in the testing above or the method choice could see them. Here is how every method did on that stretch.

The selected method was the most accurate here too: off by about 13%.

How far off each method was on the held-back 168 hours
MethodOff by
4castPlannr Engine with extra inputs Selected13%
4castPlannr Engine17.5%
Theta method33.4%
Exponential smoothing33.7%
Repeat last season58.9%
Repeat the last value83.9%

What the engine noticed in the data

  • Forecast made as of Dec 02, 2012: 694 later rows were hidden from the models and used afterwards to check the forecast.

Technical details

Data
Bike Sharing Dataset (UCI ML Repository #275; Capital Bikeshare, Washington DC). 1 series, hourly, from 2011-01-01 to 2012-12-02.
How we prepared the data
Hourly total rentals (cnt). The data ends in Dec 2012, so the forecast is made as of Dec 2, 2012 and checked against the following week. Weather for that week is taken from the actual records, which stands in for a perfect weather forecast, so the 'with covariates' result is optimistic. The request also asks for casual vs. registered riders; those columns add up to the total, so they are not used as inputs (the engine would remove them anyway).
Testing
5 tests on past data, each 7 days (168 hours) ahead.
Methods
4castPlannr Engine with extra inputs, 4castPlannr Engine, Exponential smoothing (ETS), Theta (smoothed trend line), Seasonal naive (repeat the last cycle), Naive (repeat the last value).
Reproduce
The case folder, spec and outputs are in the 4castPlannr repository under cases/uci-bike-sharing/.
For the data people

Rolling-origin backtest with 5 cutoffs. "Off by" is WAPE (weighted absolute percentage error: total absolute error divided by total actual volume). MASE for the selected method: 0.83 (below 1 beats a seasonal naive forecast on the training data).

Data source and license

Fanaee-T, H. & Gama, J. (2013). Event labeling combining ensemble detectors and background knowledge. Progress in AI, doi:10.1007/s13748-013-0040-3. Data: UCI ML Repository, https://doi.org/10.24432/C5W894, CC BY 4.0. Raw trip data: Capital Bikeshare.

License: CC BY 4.0. Source: original data. The forecasts and charts on this page are derived from that data and carry the same attribution.

Have a decision like this?

This case is an example of staffing plans for call centers and service businesses. Send us your own export and question, and we will run the same tests on your data.

Related case studies

  • Contact center staffing plan

    San Francisco 311 public data: daily phone, web and app requests forecast six weeks ahead, and an agent shift plan replayed on the weeks that followed.

    San Francisco, United States · off by about 10% · 26% closer than repeating last season

  • Hotel room-nights

    A public dataset from two hotels: daily room-nights forecast 60 days ahead per hotel, with the accuracy we measured in testing.

    Portugal · off by about 29% · 39% closer than repeating last season

  • Airport passengers by airline

    San Francisco International Airport's public statistics: monthly passengers for the 10 largest airlines forecast a year ahead.

    San Francisco, United States · off by about 13% · 29% closer than repeating last season