Skip to content

ateszk0/TrafficPredictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Traffic Predictor AI 🚦

A Python-based traffic forecasting system that uses machine learning (XGBoost) to estimate road traffic intensity based on various weather and calendar data. The project includes a data processing unit, a model training script, and a modern, dark-mode graphical user interface (GUI).

✨ Features

  • Automated Data Processing: Cleaning raw traffic data and extracting key features.
  • XGBoost Regression Model: High-precision traffic estimation based on historical data.
  • Interactive Dashboard: User-friendly interface for adjusting prediction parameters.
  • Live Weather Integration: Real-time forecast retrieval using the Open-Meteo API.
  • Visual Analysis: 24-hour traffic trend visualization on a graph.

πŸ“‚ Project Structure

The project consists of three main components:

  1. ConverterV2.py: Data preparation script. It converts units (Kelvin -> Celsius), handles missing data, and calculates calendar variables (weekend, holiday).
  2. Learning.py: Machine learning module. It loads the prepared data, trains the XGBRegressor model, and saves it into a .pkl file.
  3. App.py: The main application. A customtkinter-based interface where predictions can be run using manually entered or API-fetched data.

πŸš€ Usage

Using the system involves three simple steps:

1. Data Processing

Run the ConverterV2.py script to transform the raw database (Metro_Interstate_Traffic_Volume.csv):

python scripts/ConverterV2.py

This will create the AI_ready_traffic_data.csv file.

2. Model Training

Train the AI model on the processed data:

python scripts/Learning.py

At the end of the process, the traffic_model(Regressor).pkl file containing the trained model will be created.

3. Launching the App

Start the graphical dashboard:

python scripts/App.py

πŸ“Š Data Source & API

βš–οΈ License

It is free to use and modify.

About

Predicts traffic by Date, Time and Weather

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages