Skip to content

omarmhaimdat/air_pollution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build an iOS Application to Predict Air Pollution Using a Random Forest Regressor

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.

Final Results

Train the model

MacOS, Linux & Windows:

python API/train.py

Usage example

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.

Run the API

MacOS, Linux & Windows:

python API/app.py

API call example

http:https://127.0.0.1:5000/{day}{month}{year}{hour}

January 18, 2020 at 23:00

http:https://127.0.0.1:5000/1801202023

About me

Omar MHAIMDAT:

Linkedin: Linkedin profile

Email: [email protected]

Distributed under the MIT license. See LICENSE for more information.

Other projects

Face detection and recognition with CoreML and ARKit

Creating a License Plate Reading iOS Application Using OCR Technologies and CoreData

Using Core ML and Natural Language for Sentiment Analysis on iOS

Building a Sound Classification iOS Application using AI