Coder Social home page Coder Social logo

bike-demand-models's Introduction

COMP3901: Predicting Station-level Hourly Bike-Sharing Demand Using XGBoost and LSTM

This project applies XGBoost and Long Short-Term Memory (LSTM) to the problem of predicting station-level hourly bike-sharing demand. An in-depth project discussion can be found in COMP3901 Research Report.pdf and COMP3901 Presentation.pdf.

Introduction

The world’s population is expected to increase by 2 billion people over the next 30 years. This will mean a significant increase in motorized vehicle use, which will lead to more congestion, noise, pollution, and greenhouse gas emissions. Bike-Sharing systems pose one possible solution to this problem by reducing motorized vehicle use. Bike-sharing systems are a shared transport service that allows for short-term bike rental at unattended urban locations. They can lead to numerous benefits including a reduction in congestion, noise, pollution, and greenhouse gas emissions and improved public health; however, we only see these benefits if the bike fleets are rebalanced well, as poor rebalancing often leads to increased traffic congestion due to the manual relocation of bikes. As a result, accurately predicting bike-demand is a significant component in actually seeing these benefits; moreover, that is the problem my research addresses.

Data Sets

This study used two data sets: New York City Citi Bike bike-sharing demand data and National Oceanic and Atmospheric Administration (NOAA) meteorological data, from May 1st, 2019 to July 31st, 2019.

The Citi Bike data set includes data on Citi Bike trips made throughout New York City, United States. More specifically, the Citi Bike data set includes station ID, station latitude and longitude, start time and date, stop time and date, start and end station names, station latitudes and longitudes, bike ID, user type, gender, and year of birth. The Citi Bike data set can be found here.

The NOAA meteorological data set includes meteorological data for a weather station located in Central Park in New York City, United States. More specifically, the NOAA data set includes daily minimum and maximum temperatures, precipitation, snowfall, snow depth, average wind speed, and the presence of specific weather types, such as fog, heavy fog, thunder, ice pellets, and numerous others. The NOAA data set can be found here.

Installation and Dependencies

Download the source code from the master branch.

Running the code requires Python 3.7.2 and JupyterLab 3.0.14. You can find the installation documentation for JupyterLab.

For a local installation, make sure you have pip installed and run:

$ pip install notebook

The following Python packages are also required: Pandas, Numpy, Matplotlib, Seaborn, Scipy, Scikit-learn, Tensorflow, XGBoost.

Next, navigate to the project folder from a terminal and run

$ jupyter notebook

This will automatically open the jupyter notebook!

Notebooks

The following four notebooks were used:

  • Data Cleaning: Clean the input data sets
  • Data Analysis, Feature Engineering: Explore the cleaned data set and engineer features for the XGBoost and LSTM Models
  • XGBoost: XGBoost model for predicting hourly station-level bike demand
  • LSTM: LSTM model for predicting hourly station-level bike demand

Conclusions

This project applied XGBoost and LSTM to the problem of station-level hourly bike demand. Both models utilized the New York City Citi Bike bike-sharing and National Oceanic and Atmospheric Administration (NOAA) meteorological data sets from May 1st, 2019 to July 31st, 2019. RMSE, MAE, and R2 were used to compare the performance of the XGBoost and LSTM models. The XGBoost model outperforms the LSTM model in all three metrics. Furthermore, the XGBoost model also better predicts peaks in bike demand, thereby reducing instances of large errors between predicted demand and actual demand. Moreover, reducing these large errors is of particular importance when rebalancing bike fleets.

bike-demand-models's People

Contributors

mgysel avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.