This project uses recurrent neural network (RNN) models with LSTM layers to predict the number of bicycles available at Bicing Barcelona stations in future timeframes. An approach has been implemented where individual models are generated for each time interval. During testing, the day has been divided into 30-minute intervals, resulting in a total of 48 time slots and, consequently, the creation of 48 different models. This strategy facilitates the capture of specific patterns and trends for each moment of the day. The data used in this project were provided by Bicing Barcelona and contain detailed historical information about bicycle availability at each station at different time intervals.
./data/raw/
: Files to process obtained from the official source OpenData Ajuntament Barcelona. All the files from 2023 are here. For the most recent data, users should check online.
./data/dataframes/
: Dataframes created to organize the data in a way that makes it easy to consume.
./models/
: Contain folders where each one implements different prediction models.
./models/analyze_models.ipynb
: Collect the predictions made by each of the models in a single location, and then analyze the results.
./config.json
: Centralized configuration file.
- Prepare the development environment:
sudo apt-get update
sudo apt-get install python3-pip
git clone https://github.com/elbanche/Bikesharing_Forecast_with_LSTM-RNN_using_BicingBCN_data.git
cd Bikesharing_Forecast_with_LSTM-RNN_using_BicingBCN_data
pip install -r requirements.txt
chmod +x script.sh
-
Put all data files into the directory ./data/raw/.
-
Configure the config.json file
-
Process the data, train all models, and execute testing for each one using the following instruction:
./script.sh
- Analyze the results from the Jupyter Notebook named 'analyze_models'.
The following image shows a comparison between actual values and predictions generated by the model. The predictions correspond to a time window of 3 hours.
Feel free to reach out to me at elbanche@gmail.com. I'm always open to feedback and ideas.