William Parker commited on
Commit
ef02bce
·
1 Parent(s): c431cb8

Publish Space.

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .env.example +1 -0
  2. .gitignore +4 -0
  3. .vscode/settings.json +32 -0
  4. README.md +53 -4
  5. environment.yml +6 -0
  6. models/ATL/weather_cancellation_classification.pkl +3 -0
  7. models/ATL/weather_delay_classification.pkl +3 -0
  8. models/ATL/weather_delay_regression.pkl +3 -0
  9. models/AUS/weather_cancellation_classification.pkl +3 -0
  10. models/AUS/weather_delay_classification.pkl +3 -0
  11. models/AUS/weather_delay_regression.pkl +3 -0
  12. models/BNA/weather_cancellation_classification.pkl +3 -0
  13. models/BNA/weather_delay_classification.pkl +3 -0
  14. models/BNA/weather_delay_regression.pkl +3 -0
  15. models/BOS/weather_cancellation_classification.pkl +3 -0
  16. models/BOS/weather_delay_classification.pkl +3 -0
  17. models/BOS/weather_delay_regression.pkl +3 -0
  18. models/BWI/weather_cancellation_classification.pkl +3 -0
  19. models/BWI/weather_delay_classification.pkl +3 -0
  20. models/BWI/weather_delay_regression.pkl +3 -0
  21. models/CLT/weather_cancellation_classification.pkl +3 -0
  22. models/CLT/weather_delay_classification.pkl +3 -0
  23. models/CLT/weather_delay_regression.pkl +3 -0
  24. models/DCA/weather_cancellation_classification.pkl +3 -0
  25. models/DCA/weather_delay_classification.pkl +3 -0
  26. models/DCA/weather_delay_regression.pkl +3 -0
  27. models/DEN/weather_cancellation_classification.pkl +3 -0
  28. models/DEN/weather_delay_classification.pkl +3 -0
  29. models/DEN/weather_delay_regression.pkl +3 -0
  30. models/DFW/weather_cancellation_classification.pkl +3 -0
  31. models/DFW/weather_delay_classification.pkl +3 -0
  32. models/DFW/weather_delay_regression.pkl +3 -0
  33. models/DTW/weather_cancellation_classification.pkl +3 -0
  34. models/DTW/weather_delay_classification.pkl +3 -0
  35. models/DTW/weather_delay_regression.pkl +3 -0
  36. models/EWR/weather_cancellation_classification.pkl +3 -0
  37. models/EWR/weather_delay_classification.pkl +3 -0
  38. models/EWR/weather_delay_regression.pkl +3 -0
  39. models/FLL/weather_cancellation_classification.pkl +3 -0
  40. models/FLL/weather_delay_classification.pkl +3 -0
  41. models/FLL/weather_delay_regression.pkl +3 -0
  42. models/IAD/weather_cancellation_classification.pkl +3 -0
  43. models/IAD/weather_delay_classification.pkl +3 -0
  44. models/IAD/weather_delay_regression.pkl +3 -0
  45. models/IAH/weather_cancellation_classification.pkl +3 -0
  46. models/IAH/weather_delay_classification.pkl +3 -0
  47. models/IAH/weather_delay_regression.pkl +3 -0
  48. models/JFK/weather_cancellation_classification.pkl +3 -0
  49. models/JFK/weather_delay_classification.pkl +3 -0
  50. models/JFK/weather_delay_regression.pkl +3 -0
.env.example ADDED
@@ -0,0 +1 @@
 
 
1
+ OPEN_WEATHER_API_KEY=
.gitignore ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ .conda/
2
+ .mypy_cache/
3
+ .env
4
+ __pycache__/
.vscode/settings.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cSpell.words": [
3
+ "autoflake",
4
+ "CMPE",
5
+ "dotenv",
6
+ "dtype",
7
+ "dwpf",
8
+ "fillna",
9
+ "iloc",
10
+ "ipynb",
11
+ "isin",
12
+ "isort",
13
+ "iterrows",
14
+ "joblib",
15
+ "Kaggle",
16
+ "mypy",
17
+ "ndarray",
18
+ "openweathermap",
19
+ "proba",
20
+ "pylint",
21
+ "pytz",
22
+ "relh",
23
+ "rmse",
24
+ "SJSU",
25
+ "sknt",
26
+ "tmpf",
27
+ "tqdm",
28
+ "unvalidated",
29
+ "xlabel",
30
+ "ylabel"
31
+ ]
32
+ }
README.md CHANGED
@@ -1,13 +1,62 @@
1
  ---
2
  title: FlightSure
3
- emoji: 🌍
4
  colorFrom: blue
5
  colorTo: indigo
6
  sdk: gradio
7
  sdk_version: 4.29.0
8
- app_file: app.py
9
  pinned: false
10
- license: apache-2.0
11
  ---
12
 
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  title: FlightSure
3
+ emoji: ✈️
4
  colorFrom: blue
5
  colorTo: indigo
6
  sdk: gradio
7
  sdk_version: 4.29.0
8
+ app_file: src/app.py
9
  pinned: false
10
+ license: gpl-3.0
11
  ---
12
 
13
+ # FlightSure: Using Machine Learning to Find the Chance a Flight is on Time
14
+
15
+ ## Description:
16
+ 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.
17
+
18
+ Dataset used to train the models hosted on Kaggle: https://www.kaggle.com/datasets/williamparker20/flight-ontime-reporting-with-weather/data
19
+
20
+ 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.
21
+
22
+ ### Users Note:
23
+ The date of departure interface will automatically submit the request. Please input the date last, or else the app will not work.
24
+
25
+ ## OpenWeather API
26
+ 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.
27
+
28
+ ### HuggingFace Spaces
29
+ 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.
30
+
31
+ ## Format of project
32
+ - `models/`: Contains the trained models, arranged by airport, each folder containing:
33
+ - `weather_cancellation_classification.pkl`: Classifies if the flight will be canceled.
34
+ - `weather_delay_classification.pkl`: Classifies if the flight will be delayed.
35
+ - `weather_delay_regression.pkl`: If the flight is delayed, predicts how long the delay will last.
36
+ - `notebooks`: Contains the notebooks I used to generate the dataset, process the data, and generate the models.
37
+ - `data_cleaning.ipynb`: Main notebook to generate the dataset for the project.
38
+ - `for_presentation.ipynb`: some small code snippets used for creating images in the project presentation.
39
+ - `pickle_helper_notebook.ipynb`: Notebook for making the object in the `helpers/` folder.
40
+ - `predict.ipynb`: Main notebook to create the models used in the `models/` folder.
41
+ - `prediction_test.ipynb`: Notebook used to figure out what to do in `predict.ipynb`.
42
+ - `src/`: Source code for the main app.
43
+ - `helpers/` Small objects loaded in by the main app.
44
+ - `app.py` Main code for the app
45
+ - `open_weather.py` Interface for app to connect to OpenWeather
46
+ - `.env`: Contains the API keys for the weather API.
47
+ - `pickle_helper_notebook`: Notebook used to generate small pieces of data for the app.
48
+ - `data_cleaning`: Main script to generate dataset used to train models.
49
+
50
+ ## Installation:
51
+ 1. Clone the repository.
52
+ 2. (Optional) Create a `.env` file and add your OpenWeather API key.
53
+ 3. create the anaconda environment with `conda env create -f environment.yml`
54
+ 4. Activate the environment using `conda activate flight-sure`
55
+ 5. Run the app with `python src/app.py`
56
+
57
+ ## Checkers and Formatters:
58
+ These tools were used just to improve readability of project.
59
+ - **Linter**: `pylint src`
60
+ - **Type Checker**: `mypy src`
61
+ - **Formatter**: `black src`
62
+ - **Import Formatter**: `isort src`
environment.yml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ name: flight-sure
2
+ dependencies:
3
+ - python=3.11.9
4
+ - pip
5
+ - pip:
6
+ - -r requirements.txt
models/ATL/weather_cancellation_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9db2edbe10e02345017a1152299efdbc4ea8d329632078477524403c445f9ccd
3
+ size 73504793
models/ATL/weather_delay_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:beb99dd74c4b085a82939c4d6eb3e8700221ae726e226e4d67ac36c15b3f853a
3
+ size 298955513
models/ATL/weather_delay_regression.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f43bdf236bd2adb4110a11cbd135ce6a02c0f59c7c230b656cc48c009e34124
3
+ size 1008
models/AUS/weather_cancellation_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8db0ce185ec507a27fcab4b7f271af1beee05801078c3e4211e7dd567320a6d
3
+ size 51039641
models/AUS/weather_delay_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1971397d3ed912c0aa25bc4de70e36937e2a6d242f4c951669cf1a89cab976e0
3
+ size 215650521
models/AUS/weather_delay_regression.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:055a764152b3112a948240abd2495285346406ab4781dd0919418601ffc49e78
3
+ size 1008
models/BNA/weather_cancellation_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:00a50ce2bc9fb1314eb6d748d35efdf3f8d96674d9cb68c739573d79e8b2e9d3
3
+ size 61932761
models/BNA/weather_delay_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c814d286ea5c02944a0d47529113da65c054e4e6c1e537c7ed06e5308b462098
3
+ size 220363161
models/BNA/weather_delay_regression.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:595efa8cfed5ffc94d996dac55e58fa5d01c52909983d906390a4340994b585e
3
+ size 1008
models/BOS/weather_cancellation_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:176985a93ccab83bdc46191965fd90e21cdca06caf24437a852b1a56c4d8869e
3
+ size 68831321
models/BOS/weather_delay_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75f26312d294f40a604e785d3a90b73224e54d49deef816323b9a1247bb8cb48
3
+ size 279508761
models/BOS/weather_delay_regression.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8aca89e002317b91d1c1235c6d4c03b4dd7e0ae407c7e7fc1bed4b11f45e4a2
3
+ size 1008
models/BWI/weather_cancellation_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb58d3231365a797b3b3c503c737643d1492146479de5d31204c60d8a92058e7
3
+ size 58311801
models/BWI/weather_delay_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e758df1d7fbe06839c3ebb427cb6629c9bddb9f86850c2a8ccfd1b992f86c174
3
+ size 229041081
models/BWI/weather_delay_regression.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e38ae17db8e56bc3d5ab027d526d75e1717d24a4c3f3f05c1392c781e39806f3
3
+ size 1008
models/CLT/weather_cancellation_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfba68fe67fc36c2e057a449d25192fe6510aa876379474cface1b3a50d8c247
3
+ size 83094681
models/CLT/weather_delay_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa745b9c6e07b634d833c0d9bfc5cb2e20828f581c4c96007ae5be1ef98d5527
3
+ size 269578201
models/CLT/weather_delay_regression.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b6ed61966f5ed67042bcf6d5aebd1ed11ae83ed70669ec3544dde313a7b4ee5
3
+ size 1008
models/DCA/weather_cancellation_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3618d5a5ebf13bdbf390dc26678cd3cd1c894cf7b2f08000ebfda7d2cfc661fb
3
+ size 93297721
models/DCA/weather_delay_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40f8ddc5494230990047a3037a64ccd867f819b3d5188cffa4dce83eab81478e
3
+ size 266920281
models/DCA/weather_delay_regression.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4263a6a3cacbbf0391dc07d767acc1d83801e9b0c7e6705be17b2c3adf53035d
3
+ size 1008
models/DEN/weather_cancellation_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb4b9fac6a9faef18270fcb6556a8f2098108e3b9568f2adaec6284abe0a4467
3
+ size 126244281
models/DEN/weather_delay_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a7f5f92f3655f4f71eb58fbb81191b2fc53b9dc2563099f2236dcb63c8c1e2ea
3
+ size 333639641
models/DEN/weather_delay_regression.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a058adc74ae25824c3b80aebbfce4bd6d8b8b260a8cd91febafcd6c3d88390aa
3
+ size 1008
models/DFW/weather_cancellation_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ab09b9f48eacbcb252fe719725b439a1e2e6c9bc5fc308050c907f1d025951c6
3
+ size 109256601
models/DFW/weather_delay_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c1b6e06cad3f6cb5d87a478b7ace9908d9775717ff5340776bbd025e4a579c3
3
+ size 291711801
models/DFW/weather_delay_regression.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93d98018ac674ae4e8b9429e45202ab8daa4bac84211121aea8c359fdd8f091d
3
+ size 1008
models/DTW/weather_cancellation_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e43b5784016647dd3e231d16b54c8d19e774d86a6991d5fc047a5db074e7f83d
3
+ size 57800281
models/DTW/weather_delay_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ce9c0c53dee2acd402163c49621909d5f7d2a95b901e9b495e3c54e207ef6eb
3
+ size 270817401
models/DTW/weather_delay_regression.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98e2290671ec3032626abfe4c4cb84187a6041b6ab74913d6b250b3bdfbbf427
3
+ size 1008
models/EWR/weather_cancellation_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e5afccfb1ba158baf8ac97ed679d6da44cde1fedbdacc3346e7d761434cef31f
3
+ size 90550841
models/EWR/weather_delay_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:443784345ed94bf787fbae10f6f95d110212db0325f865592b32d1198312fffb
3
+ size 266498681
models/EWR/weather_delay_regression.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2bcf7625cb47a678de7106686c2e798a3e3baef8b3a733a4794e49ad201da51d
3
+ size 1008
models/FLL/weather_cancellation_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:220c49b31806313f7bd06b5767203f8bbaba746911031c713a93291420c82172
3
+ size 53438361
models/FLL/weather_delay_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7232aee0d7c356d1cf288701200ccd353a28d4b419b9e1507ca5fabaaf2ffdf6
3
+ size 197078361
models/FLL/weather_delay_regression.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de8787e4230874c0531efcb32129a1a9c45aff326c73ff12510e9a294c3256cd
3
+ size 1008
models/IAD/weather_cancellation_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e12d6819ad6f6f743ff94955efbcffed2cc794444da22ac5ae498c199e33f438
3
+ size 32697241
models/IAD/weather_delay_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c89a939be4002ad8959ca4cf7ea6b8a7103a62964b58f0a7e53f75770ff1f17
3
+ size 150971001
models/IAD/weather_delay_regression.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:170d8c18e958f901cc7a917e335e0ba7dd76a74c46e9ce1fde936ab057e9ca9c
3
+ size 1008
models/IAH/weather_cancellation_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be656af69f65dc06519a8cd102a481faa08f137064411aeb61645a46c3ec36d2
3
+ size 59139801
models/IAH/weather_delay_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:977ef4dc97d3aab7e48f786883d297e7e2730ae923747dc57b5462b2af90bbcf
3
+ size 217869881
models/IAH/weather_delay_regression.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8011b892a8fe630179ee1cebba3e7dbf8fc9bdb18793ddeb873751dd19652d8d
3
+ size 1008
models/JFK/weather_cancellation_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa182fd002902a40f3bf897c6cd4f8697f1433c3ca1eeff394ec2f3a1abe2609
3
+ size 55531801
models/JFK/weather_delay_classification.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec8e9711c40e0a0970cb43cd3d3b4426cc92e22bf18f7585ddde9fa710d8e03d
3
+ size 256119641
models/JFK/weather_delay_regression.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0bfde53b039e9076d4ddbbe2df9da5a28d04928cd623c1a8964798f2ca61b505
3
+ size 1008