# Advanced GTFS Public Transport Analysis for Bamako Sotrama
This repository contains an advanced analysis of public transport data for Bamako's Sotrama system using GTFS (General Transit Feed Specification) data and the MovingPandas library. The analysis includes data preprocessing, exploratory analysis, predictive modeling, demand forecasting, and interactive visualization.
## Repository Structure
- `analysis_part1.py` to `analysis_part5.py`: Python scripts containing the analysis code in modular sections
- `run_analysis.py`: Entry point script to run the complete analysis
- `models/`: Directory for saved machine learning models
- `visualizations/`: Directory for saved visualizations
## Features
This analysis implements several advanced features:
### 1. Predictive Modeling of Travel Times
- Multiple machine learning models (Random Forest, XGBoost, Gradient Boosting, Neural Networks)
- Advanced feature engineering incorporating time of day, route information, and dwell times
- Model evaluation, comparison, and selection
- Feature importance analysis
- Proper model saving and loading
### 2. Identification of Operational Bottlenecks
- Analysis of travel times to identify potential bottlenecks
- Time-of-day analysis of bottlenecks
- Visualization of bottlenecks on an interactive map
- Dwell time analysis at bottleneck locations
### 3. Demand Forecasting and Optimization
- Passenger demand prediction using machine learning
- Route efficiency analysis
- Identification of high-demand stops
- Suggestions for potential new connections between high-demand stops
### 4. Cluster Analysis for Pattern Recognition
- DBSCAN and K-Means clustering to identify similar travel patterns
- PCA for dimensionality reduction and visualization
- Analysis of cluster characteristics
- Route-cluster distribution analysis
### 5. Interactive Map Visualization
- Folium-based interactive map showing stops, routes, and bottlenecks
- Heatmap visualization of bottlenecks
- Marker clusters f …