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.
Before you begin, ensure you have met the following requirements:
- You have a
Linux
machine. - You have installed python 3 and mongodb.
In any situation you will have to follow these steps:
- Clone the repository:
git clone https://github.com/raniatze/Archimedes-OASA1-Project
- Change into the project directory:
cd Archimedes-OASA1-Project
- Install the necessary dependencies:
pip install -r requirements.txt
- Create the starting database with all necessary data, except the AKE data.
sh makeDB.sh
To run RideInsight, follow these steps, if you have the historical AKE data in your database:
- Get the weather for the day:
python3 get_weather_today.py
- Get the predictions for the day:
python3 make_predictions.py
- Run the application:
cd App/
python3 app.py
If you have your own AKE data, such as the file in Data/ake_sample.csv, you must process it as described below:
- Assuming your data is in an AKE.zip file, unzip it like this:
cd Archimedes-OASA1-Project
unzip AKE.zip
- If your data doesn't have headers, run:
python3 addHeaders.py
- 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 ','
- Process and enhance your AKE data with:
python3 process_ake.py
- Insert your enhanced AKE data into your database:
python3 insertAKE.py
If you wish to train the machine learning model yourself, follow these steps:
-
Process your AKE data as shown above.
-
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
- 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
To contribute to Project Title, follow these steps:
- Fork this repository.
- Create a branch:
git checkout -b <branch_name>
. - Make your changes and commit them:
git commit -m '<commit_message>'
- Push to the original branch: `git push origin Archimedes-OASA1-Project
- Create the pull request.
Alternatively, see the GitHub documentation on creating a pull request.
If you want to contact us, reach us at archimedesai.gr/en/contact
.
This project uses the following license: license_name.