Skip to content

parishwadomkar/Investigating-machine-learning-for-simulating-urban-transport-patterns

Repository files navigation

Investigating-machine-learning-for-simulating-urban-transport-patterns

Comparative analysis for Machine Learning vs Traditional Gravity Model DOI

This repository contains the code for a research paper on a comprehensive transport model for trip predictions. The research investigates the data requirements for trips at the city level with considerable diversity and compares simulations based on SIM and Machine Learning models.

Research Description

The full research paper can be found here (https://www.sciencedirect.com/science/article/pii/S2772586323000175). The research focuses on developing a machine learning model for predicting trip patterns in urban areas based on various factors such as time of day, day of the week, weather conditions, and more. The model uses data from trip logs provided by Telia company, which has been anonymized to protect privacy.

The research also includes network analysis to calculate the shortest distance between all urban districts, which is used for further analysis in the spatial interaction model (SIM) as well as the machine learning model for the parameter calculations of cost of transport. The spatial interaction model is developed based on Wilson's ideology of Gravity theory.

The interactive dashboard is available over the hosted platform pythonanywhere, powered specifically for Python web applications. The programming in Python is based on Dash and uses IBM Watson (Cloud Technology) as a backend where the machine learning model is deployed. The SHAP analysis for the XGBoost regression model is included in the Google Colab notebook.

Interactive Dashboard and Backend Programming

The interactive dashboard is available over the hosted platform 'pythonanywhere', powered specifically for Python web applications. The programming in Python is based on Dash and uses IBM Watson (Cloud Technology) as a backend where the ML model is deployed. The files and code are available over the web interface here: [InteractiveApp](http://transportmodelapp.pythonanywhere.com/). (Sign in Username: 'Omkar' Password: '12345') PS. The backend over IBM Watson has been disconnected due to a security breach. We are shifting to AWS to upgrade to a better, safer backend.

WEBSITE

Network Analysis

The network analysis is based on the OSM files invoked over the Python notebook. The shortest path algorithm gives the shortest distance between all the Urban Districts. This distance is used for further analysis in the SIM and the machine learning model for the parameter calculations of the transport cost.

Spatial Interaction Model

The spatial interaction model (SIM) is hosted over a notebook in the IBM Watson console for obtaining predictions. The family of SIM is developed based on Wilson's ideology of Gravity theory.

Machine Learning Model

Various machine learning algorithms were tried for the best fit. The Extreme Gradient Boost (XGB) algorithm gives the best fit for available 2019 data. Sensitivity analysis was used to prioritize and select the most efficient parameters for the model.

The machine learning model is deployed in the backend over IBM Watson. The deployed model consumes the configuration at an average of 2.5 Capacity Unit Hour (CUH) for every run of the analysis. Even with a low processing capacity, the model has relatively fast processing for analysis.

It is possible to develop the model by providing the ability to upload the parameters and invoke the road network over OSM or Mapbox GL JS (for the faster and more accurate analytical ability of cost of transport, including the waiting times). Using GPU (TensorFlow) would optimize the model execution time further when we use real-time data, depending on the matrix size. The SHAP analysis for the XGBoost regression model is also included here.

Usage

To use the code, you must install Python 3 and the required libraries given in the requirements file.

Contribution

Contributions to the code are welcome. If you have any questions or suggestions, please open an issue in the repository.

Confidentiality Note

WSP Sweden acquired the trip data from Telia company and has been used for this research in confidentiality. It can be made available upon request and a proper confidentiality agreement with Telia and WSP Sweden organization.

About

A Comparative analysis for Machine learning vs Traditional Gravity Model

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages