Using Swift, Flask, and sklearn to predict pollution levels on iOS
I'll create a model that can predict the level of small particles on a given day in the city of London and also create a small API that will be consumed by an iOS application.
MacOS, Linux & Windows:
python API/train.py
Download a large dataset of PM2.5 particles from your hometown for example. (In this repo I used data for London).
Clean up the data and add it to the API folder, make sure to use the column names that I have in my own csv file or you can change the script to fit your csv
file in train.py
.
Then you can call use the train.py
to train the model and save it to the current directory.
Finally, you can predict the PM2.5 particle level by running the Flask API or you can call the prediction function in predict.py
file.
MacOS, Linux & Windows:
python API/app.py
http://127.0.0.1:5000/{day}{month}{year}{hour}
January 18, 2020 at 23:00
http://127.0.0.1:5000/1801202023
Linkedin: Linkedin profile
Email: omarmhaimdat@gmail.com
Distributed under the MIT license. See LICENSE
for more information.