9.2. Predicting Bike Rentals

The data we will use in this chapter is used with the permission of Capital Bikeshare. You can download the data from their website. We are using a prepared version of this data that has already been augmented with additional weather data from the UCI Machine Learning Repository. To download the data sets click here [*].

The basic data for the sql lessons is in bikeshare.db. The additional data about weather is not needed until the last section of this chapter in which we try to predict bike rentals. Later sections of this chapter use bikeshare_11_12.db which has the same schema as bikeshare.db but data for two years instead of just one. These two files are sqllite database files, feel free to download them and use them with sqllite directly.

Predicting bike rental trends is very important from both an operational and planning perspective. Bikeshare companies need to stay up to date on rental trends to know where they should add new facilities, and how to reposition bikes to get them to the locations with the highest demand. They do not want to wait until all of the bikes are rented at a particular location before moving additional bikes into position, as that is lost revenue for them.

In the zip file you downloaded from the UCI Machine Learning Repository there are two data sets: hour.csv and day.csv. Both have the following fields (with the exception of hr which is not available in day.csv).

You can read about UCI’s work with this data set here.

You have attempted of activities on this page