A machine learning-powered web application that predicts flight delays based on historical data, weather conditions, and flight characteristics.
- Real-time Predictions: Get instant delay predictions for your flights
- Interactive UI: Modern, responsive web interface with beautiful styling
- Time-based Filtering: Filter flights by departure time ranges
- Visual Indicators: Color-coded delay risk categories (Low/Medium/High)
- Route Statistics: View delay probability distributions for specific routes
- Weather Integration: Considers weather conditions in predictions
- Frontend: Streamlit (Python web framework)
- Backend: Python 3.12+
- Machine Learning: XGBoost, Scikit-learn
- Data Processing: Pandas, NumPy
- Visualization: Plotly
- Deployment: Azure App Service
- Python 3.12 or higher
- Git
- Azure account (for deployment)
-
Clone the repository
git clone https://github.com/yourusername/flight-delay-predictor.git cd flight-delay-predictor
-
Install dependencies
pip install -r requirements.txt
-
Run the application
streamlit run app.py
-
Open your browser Navigate to
http://localhost:8501
-
Create Azure App Service
az group create --name flight-delay-predictor-rg --location eastus az appservice plan create --name flight-delay-plan --resource-group flight-delay-predictor-rg --sku B1 az webapp create --name flight-delay-predictor --resource-group flight-delay-predictor-rg --plan flight-delay-plan --runtime "PYTHON:3.12"
-
Configure deployment settings
az webapp config set --name flight-delay-predictor --resource-group flight-delay-predictor-rg --startup-file "streamlit run app.py --server.port 8000 --server.address 0.0.0.0"
-
Deploy from Git
az webapp deployment source config --name flight-delay-predictor --resource-group flight-delay-predictor-rg --repo-url https://github.com/yourusername/flight-delay-predictor.git --branch main
flight-delay-predictor/
├── app.py # Main Streamlit application
├── flight_predictor.py # ML model prediction class
├── flight_delay_predictor.pkl # Trained model file
├── test_data.csv # Test dataset
├── requirements.txt # Python dependencies
├── README.md # Project documentation
├── .gitignore # Git ignore file
└── azure-deploy.yml # Azure deployment configuration
- Select Route: Choose origin and destination airports
- Pick Date: Select your travel date
- Filter Time (optional): Choose preferred departure time range
- Get Predictions: View delay predictions with risk categories
- 🟢 Low Risk (< 45%): Likely on time
- 🟡 Medium Risk (45-65%): Possible delays
- 🔴 High Risk (> 65%): High chance of delays
The application uses configurable thresholds for delay predictions:
- Main Threshold: 0.5 (50% probability for delay classification)
- Low Risk: < 45%
- Medium Risk: 45-65%
- High Risk: > 65%
You can adjust thresholds in:
app.py
: Line 180 (main threshold)flight_predictor.py
: Line 42 (model threshold)
- Algorithm: XGBoost Classifier
- Features: Weather conditions, flight times, seasonal patterns
- Training Data: Historical flight data with weather information
- Performance: Optimized for realistic delay predictions
The application is configured for Azure App Service deployment with:
- Runtime: Python 3.12
- Framework: Streamlit
- Port: 8000 (configurable)
- Scaling: Automatic (configurable)
Set these in Azure App Service Configuration:
PYTHON_VERSION=3.12
SCM_DO_BUILD_DURING_DEPLOYMENT=true
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Flight data sources
- Weather data providers
- Streamlit community
- Azure documentation
Made with ❤️ for better travel planning