Spaces:
Sleeping
A newer version of the Gradio SDK is available:
5.16.1
title: FlightSure
emoji: ✈️
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 4.29.0
app_file: src/app.py
pinned: false
license: gpl-3.0
FlightSure: Using Machine Learning to Find the Chance a Flight is on Time
Description:
FlightSure is a machine learning tool that predicts the likelihood of your flight being on time. The app takes in the airport you will depart from, and the date and time of the departure. The app then gets the forecast for your flight, and predicts the chance of your flight being delayed or canceled for weather related reasons. The model is trained on a dataset of historical flight and weather data.
Dataset used to train the models hosted on Kaggle: https://www.kaggle.com/datasets/williamparker20/flight-ontime-reporting-with-weather/data
This is my SJSU AI CMPE-255 Final Project. The data
and data_cleaning
folders were removed as they were too large for git, but can be recreated with the the data_cleaning.ipynb
script in the notebooks folder.
Users Note:
The date of departure interface will automatically submit the request. Please input the date last, or else the app will not work.
OpenWeather API
To get your own OpenWeather API key, go to https://openweathermap.org/price and sign up using the free tier. Once you have your key, add it to the .env
file in the root directory of the project.
HuggingFace Spaces
I use my personal API key for this project, so I can't upload a working version to HuggingFace spaces the way I intended. Instead, I added a new textbox to the app where you can input your own OpenWeather API key if one is not specified in the .env
file.
Format of project
models/
: Contains the trained models, arranged by airport, each folder containing:weather_cancellation_classification.pkl
: Classifies if the flight will be canceled.weather_delay_classification.pkl
: Classifies if the flight will be delayed.weather_delay_regression.pkl
: If the flight is delayed, predicts how long the delay will last.
notebooks
: Contains the notebooks I used to generate the dataset, process the data, and generate the models.data_cleaning.ipynb
: Main notebook to generate the dataset for the project.for_presentation.ipynb
: some small code snippets used for creating images in the project presentation.pickle_helper_notebook.ipynb
: Notebook for making the object in thehelpers/
folder.predict.ipynb
: Main notebook to create the models used in themodels/
folder.prediction_test.ipynb
: Notebook used to figure out what to do inpredict.ipynb
.
src/
: Source code for the main app.helpers/
Small objects loaded in by the main app.app.py
Main code for the appopen_weather.py
Interface for app to connect to OpenWeather
.env
: Contains the API keys for the weather API.pickle_helper_notebook
: Notebook used to generate small pieces of data for the app.data_cleaning
: Main script to generate dataset used to train models.
Installation:
- Clone the repository.
- (Optional) Create a
.env
file and add your OpenWeather API key. - create the anaconda environment with
conda env create -f environment.yml
- Activate the environment using
conda activate flight-sure
- Run the app with
python src/app.py
Checkers and Formatters:
These tools were used just to improve readability of project.
- Linter:
pylint src
- Type Checker:
mypy src
- Formatter:
black src
- Import Formatter:
isort src