Skip to content

raniatze/Archimedes-OASA1-Project

Repository files navigation

RideInsight: Optimizing Travel Planning with Intelligent Ridership Forecasting

Introduction

Within the context of the project "Data for Social Good" that was done in collaboration between the Hellenic Corporation of Assets and Participations (HCAP) and Archimedes Research Unit, we built a prototype tool-application that solves the problem of predicting the occupancy of a public mode of transport (trolleybus or bus). This prediction is critical for better transportation planning and optimization. By identifying the factors that influence occupancy, we developed algorithms and prediction models, which can help in better and more efficient route planning, as well as correctly informing the traveling public about the occupancy of the means of transport they use.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have a Linux machine.
  • You have installed python 3 and mongodb.

Necessary steps

In any situation you will have to follow these steps:

  1. Clone the repository:
git clone https://github.com/raniatze/Archimedes-OASA1-Project
  1. Change into the project directory:
cd Archimedes-OASA1-Project
  1. Install the necessary dependencies:
pip install -r requirements.txt
  1. Create the starting database with all necessary data, except the AKE data.
sh makeDB.sh

Running the Application

To run RideInsight, follow these steps, if you have the historical AKE data in your database:

  1. Get the weather for the day:
python3 get_weather_today.py
  1. Get the predictions for the day:
python3 make_predictions.py
  1. Run the application:
cd App/
python3 app.py

Processing your AKE data

If you have your own AKE data, such as the file in Data/ake_sample.csv, you must process it as described below:

  1. Assuming your data is in an AKE.zip file, unzip it like this:
cd Archimedes-OASA1-Project
unzip AKE.zip
  1. If your data doesn't have headers, run:
python3 addHeaders.py
  1. Get historical weather data. Be sure to specify the correct time period in the code:
python3 get_weather.py
python3 inserter.py -f weathers.csv -c weather -s ','
  1. Process and enhance your AKE data with:
python3 process_ake.py
  1. Insert your enhanced AKE data into your database:
python3 insertAKE.py

Training the Machine Learning Model

If you wish to train the machine learning model yourself, follow these steps:

  1. Process your AKE data as shown above.

  2. Prepare this data for training. You can change the number of previous stops and days by changing the m and n parameters. Also, you must specify the line encoding that corresponds to the bus line for which you want to train the model by changing the line_encoding value. This is done so you don't have to process it all at once.

python3 prepare_model_dataset.py
  1. Train your model. Check that the m, n parameters have the same values as in the previous step. Also, you can change the model, batch_size and number of epochs.
python3 train_model.py

Contributing to Project Title

To contribute to Project Title, follow these steps:

  1. Fork this repository.
  2. Create a branch: git checkout -b <branch_name>.
  3. Make your changes and commit them: git commit -m '<commit_message>'
  4. Push to the original branch: `git push origin Archimedes-OASA1-Project
  5. Create the pull request.

Alternatively, see the GitHub documentation on creating a pull request.

Contact

If you want to contact us, reach us at archimedesai.gr/en/contact.

License

This project uses the following license: license_name.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •