# 9.1. 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 which you can download from the UCI Machine Learning Repository

Predicting bike rental trends is very important from both an operational and planning perspective. Bike share companies need to stay up to date on rental trends to know where they should add new facilities, and they need to reposition bikes every day 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.

Both hour.csv and day.csv have the following fields, except hr which is not available in day.csv

• instant: record index
• dteday : date
• season : season (1:spring, 2:summer, 3:fall, 4:winter)
• yr : year (0: 2011, 1:2012)
• mnth : month ( 1 to 12)
• hr : hour (0 to 23)
• holiday : weather day is holiday or not (extracted from [Web Link])
• weekday : day of the week
• workingday : if day is neither weekend nor holiday is 1, otherwise is 0.
• weathersit :
• 1: Clear, Few clouds, Partly cloudy, Partly cloudy
• 2: Mist + Cloudy, Mist + Broken clouds, Mist + Few clouds, Mist
• 3: Light Snow, Light Rain + Thunderstorm + Scattered clouds, Light Rain + Scattered clouds
• 4: Heavy Rain + Ice Pellets + Thunderstorm + Mist, Snow + Fog
• temp : Normalized temperature in Celsius. The values are derived via (t-t_min)/(t_max-t_min), t_min=-8, t_max=+39 (only in hourly scale)
• atemp: Normalized feeling temperature in Celsius. The values are derived via (t-t_min)/(t_max-t_min), t_min=-16, t_max=+50 (only in hourly scale)
• hum: Normalized humidity. The values are divided to 100 (max)
• windspeed: Normalized wind speed. The values are divided to 67 (max)
• casual: count of casual users
• registered: count of registered users
• cnt: count of total rental bikes including both casual and registered

You can read about UCI’s work with this data set here: Fanaee-T, Hadi, and Gama, Joao, “Event labeling combining ensemble detectors and background knowledge”, Progress in Artificial Intelligence (2013): pp. 1-15, Springer Berlin Heidelberg, doi:10.1007/s13748-013-0040-3.

Next Section - 9.2. Exploring Bike Rental Data with SQL