Back to projects

Weather Delay 🚂⛈️

Gianluca Rea / July 19, 2023

🌦️ Weather Delay Prediction

This project aims to predict train delays caused by weather conditions using machine learning techniques. The repository contains the necessary code, data, and documentation to build, train, and evaluate the predictive model.

🚀 Project Overview

The goal of this project is to develop a machine learning model that can predict train delays based on weather conditions. The model will be trained on historical train data combined with weather data to identify patterns and correlations that lead to delays. The project includes data preprocessing, model training, evaluation, and deployment (optional).

📊 Data

The data used in this project consists of two main components:

  1. 🚂 Train Data: Historical train records including departure and arrival times, delays, and other relevant train information.
  2. 🌤️ Weather Data: Historical weather data including temperature, precipitation, wind speed, and other meteorological factors.

The data is stored in the data/ directory and is preprocessed before being used for training the model. The preprocessing steps include handling missing values, feature engineering, and merging train and weather datasets.

🛠️ Scripts

The repository contains several scripts to automate different tasks:

  • preprocess_data.py: Cleans and preprocesses the raw data. This includes handling missing values, encoding categorical variables, and merging train and weather datasets.
  • train_model.py: Trains the machine learning model using the preprocessed data. The script supports multiple algorithms and hyperparameter tuning.
  • evaluate_model.py: Evaluates the model's performance on a test dataset. Metrics such as accuracy, precision, recall, and F1-score are calculated.
  • app.py: A Flask application to serve the model as a REST API for real-time predictions (optional).

🤝 Contributing

Contributions are welcome! If you would like to contribute to this project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Commit your changes and push them to your fork.
  4. Submit a pull request with a detailed description of your changes.

Please ensure that your code follows the project's coding standards and includes appropriate tests.

📜 License

This project is licensed under the MIT License. See the LICENSE file for more details.