GFG Hackathon
Data Analysis of PM2.5 levels over time and the performance of machine learning models for predicting PM2.5 levels.
The following images are the distributions of PM2.5 over a time-period.
The following machine learning models were used for prediction:
The performance of each model was evaluated using the root mean squared error (RMSE) and mean absolute error (MSE).
From the analysis Neural Networks seems to be the best performing model. The Autoregressive model, as a benchmark, shows poor result. Random Forest and Explainable Boosting Machine follow in a good way shape of observations, but the previous one overfit. Neural Networks are able to capture spikes in the observations following the shape of them. In all models the lag feature shifted by an hour is the most relevant to explain the outcome, the others change depending by the model. From the Partial Dependence Plot there is a confirm about the positive correlation between the ”lagged 1h” feature and the air pollution.
The Climate Patterns feature allows users to retrieve current weather data for a specified location, including temperature, humidity, wind speed, and more.
The weather data is retrieved from the Weather by API-Ninjas using RapidAPI furnishing real-time insights.
The app retrieves the following weather data:
- Temperature: Current temperature in Celsius.
- Feels Like: The "feels like" temperature in Celsius.
- Humidity: Humidity percentage.
- Min Temperature: Minimum temperature in Celsius.
- Max Temperature: Maximum temperature in Celsius.
- Wind Speed: Wind speed in meters per second.
- Wind Degrees: Wind direction in degrees.
- Sunrise: Time of sunrise.
- Sunset: Time of sunset.
- Cloud Coverage: Cloud coverage percentage.
-
Clone this repository to your local machine.
-
Install the required Python libraries using
pip install -r requirements.txt
. -
Replace
"API_KEY"
with your actual API key in the Flask app code (app.py
). -
Run the Flask app using
python app.py
. -
Access the app in your web browser at
http://localhost:5000
. -
Use the "Air Quality" and "Climate Patterns" buttons to access the respective functionalities.
-
For "Air Quality," input a date to get PM2.5 predictions.
-
For "Climate Patterns," input a city, state, country, and pincode to retrieve weather data.