This repository has all the files and necessary documentation for DS 4002 Project 2, a project analyzing the pollution levels in an Italian city over time. This project specifically looks at how day/night and weekday/weekend cycles effect pollution levels.
- Python
The following add-on packages are required to run the project:
pandasnumpymatplotlibseabornscikit-learnscipy
This project was developed and tested on: Windows and Linux
Below is an outline of the folder and file structure of the project repository:
Project-Folder/
├── LICENSE
├── README.md
├── how-to-write-a-readme.md
├── data/
│ ├── AirQualityUCI.csv
│ ├── Data Appendix.pdf
│ └── day_weekday_data_flags.csv
├── output/
│ ├── day_weekday_correlations.csv
│ ├── linear_reg_day_weekday_results.csv
│ ├── linear_regression_predictive_evaluation.csv
│ ├── linear_regression_test_metrics_by_pollutant.csv
│ ├── figure1_measurements_over_time.png
│ ├── figure2_day_night.png
│ ├── figure3_weekday_weekend.png
│ ├── figure4_volatility.png
│ ├── figure5_correlation_heatmap.png
│ └── day_weekday_correlations.png
└── scripts/
├── correlations.py
├── eda.py
└── linear_reg.py
Folder descriptions:
data/: Contains the raw csv dataset and the final version used for statistical analysis.output/: Output files (exploratory and analysis-based plots).scripts/: Contains the Python scripts used to perform EDA, linear regression, and Pearson's correlation tests.
Here is an outline for how we produced our results:
- Open a terminal or command prompt.
- Clone the repository:
git clone https://github.com/FlavienPMoise/ds4002-project2 - Navigate into the project directory by doing
cd ds4002-project-2
- Ensure that the latest version of Python is installed and create a virtual environment:
python3 -m venv venv - Activate the virtual environment:
Windows:
venv\Scripts\activatemacOS/Linux:source venv/bin/activate - Install the required packages as mentioned above using
pip install [PACKAGE NAMES HERE]
- Download the pollution dataset from UCI at https://archive.ics.uci.edu/dataset/360/air+quality, or use the one already in the data folder.
- Unzip and place the CSV file in the data/ directory, or use the one already there.
- Ensure the file name matches
AirQualityUCI.csv
- Run the EDA script:
python3 src/EDA.py - This script generates exploratory plots in the output/ folder.
- Run the linear regression script:
python linear_reg.py - This script generates correlation and test values in various .csv's the output/ folder, and a new data file in the data/folder
- Run the final correlation analysis:
python correlations.py - This script generates correlations and p values, saving them in a table .csv in the output/ folder.
- Inspect plots and tables in the output/ directory.