Bike share forecast for upcoming Thanksgiving weekend

Bike share forecast for upcoming Thanksgiving weekend

In case you plan to get around and explore Vancouver by renting a bike on this Thanksgiving weekend, I built some predictive models to forecast number of bikes that are going to be rented each hour on this long weekend. The bike share program is operated by Mobi by Shaw Go and historical bike rental data is hosted on their website.

Original article can be found on my blog and Python code on my GitHub.

Here is a quick summary of the workflow.

A little preview of the predictions for last week of July 2018.

Because we don't have actual bike rentals for the upcoming weekend, here are only the predictions.

Summarized in a table:

Data Gathering

Data is collected from three different sources:

Exploratory Analysis

Correlation with other variables.

  • Hour of day. It seems the early evening hours have the greatest demand for bike shares. Could it be an indication of riding bikes for social activities? Like going to restaurants, hanging out with friends, going to gyms, etc.
  • Holidays. Out of 10 BC statutory holidays, only 4 had more bike rides than a normal day average. Not surprisingly, all 4 had above-average day temperature.
  • Temperature. The line plot of daily bike rentals and temperature clearly shows temperature has a big impact on riding bikes. The correlation of the two (from the heatmap) is 0.71, a strong positive correlation (1.0 for perfect correlation and 0.0 means no correlation).
  • Precipitation. The correlation value is -0.17, meaning precipitation slightly and negatively impacts riding bikes. It is understandable that no one likes to bike in a rain or snow. But, this is Vancouver (or Raincouver). People do not mind a little rain and they would still bike, run, and play outside. So, rain negatively affects bike riding but not so significantly.
  • PM2.5 (air quality). In general air quality is excellent in the city. There are days that we had hazy skies due to crazy inland wildfires, but very few. So, the heatmap does not show any correlationship of PM2.5 with bike ride.

More data analysis can be found on my blog post.

Model Training

Training dataset contains hourly bike rentals for each day from 01/01/2017 to 07/24/2018.

Two decision tree models were trained: Random Forest (RF) and Gradient Boosted Trees (GBM). They are well known for delivering better performance and efficiency on noisy datasets. However, tuning hyperparameters can be some challenges so that they will not overfit

Evaluation on Test

Test is done on hourly bike rentals from 07/25/2018 to 07/31/2018. Graph below shows our predictions are very close to real number of bikes rented. YAY!!

There you go! We will see how far/close the forecasts of bike shares on the long weekend will be. Just noticed the grand Vancouver Halloween parade is going to be on this weekend, which is one week earlier than it was before. That could hugely impact the result. Nevertheless, it will be fun to watch.

Happy Thanksgiving!

Original article can be found on my blog and Python code on my GitHub.

Fran?ois Bourdeau

Business Development Director @ RSM Canada

6 年

Very cool Peng Wang, CPA, CMA, I'm sure the folks at Citi Bike, Operated by Motivate?would be interested in their predicted peak times?

回复
Peng Wang

Engineering Leader | Volunteer Board Director | Community Builder

6 年

要查看或添加评论,请登录

Peng Wang的更多文章

社区洞察

其他会员也浏览了