Vo Xuan Nhi Tran
← ALL PROJECTS

Air Quality Model

Machine learning team project, ENGG2112

Sep 2026 – Oct 2026
  • Python
  • pandas
  • scikit-learn
  • Ridge regression
  • Random Forest
  • Matplotlib
PM2.5 × ELECTRICITY MIX · CLEANING → MODELINTERACTIVE
fxenergy_df = pd.read_csv(energy_path) pm25_df = pd.read_csv(pm25_path)
World Energy Consumption.csv
ABCDEFGHIJ…
1countryyearcoal_share_elecgas_share_elecoil_share_elechydro_share_elecnuclear_share_elecsolar_share_elecwind_share_elecother_renewables_share_elecmore columns
2Sweden20190.1250.1721.69238.81439.2650.40411.7867.743
3Norway20190.031.5390.49393.61900.0074.1250.187
4Poland200393.7671.6133.121.113000.080.307
5Australia199982.7277.7930.8497.86900.020.0210.548
6South Sudan20190010000000
7Afghanistan1990
8Asia201952.72917.9433.25313.5244.5752.6863.5941.695
average-exposure-pm25-pollution.csv
ABCD
1EntityCodeYearPM2.5 air pollution, mean annual exposure (micrograms per cubic meter)
2SwedenSWE20195.99
3NorwayNOR20196.15
4PolandPOL200330.58
5AustraliaAUS19996.16
6South SudanSSD201924.23
7AfghanistanAFG199048.43
8MonacoMCO201912.56
average-exposure-pm25-pollution.csv: 7,242 rowsreal rows, a sample

1. Read both files. Two public datasets: each country’s electricity mix by year, and its average PM2.5 exposure.

FIG. 2  Step through the real cleaning code as a spreadsheet, then toggle what the model may use. Real data and models from the project, scored on test years they never saw.

Problem

A university team project asking one question: can we predict a country's air pollution (PM2.5 exposure) from how it generates its electricity?

What I built

  • The data cleaning pipeline that merges national electricity data with PM2.5 exposure into one clean table, plus the team's first baseline Random Forest.
  • The Europe regional model: 41 countries, trained on 2000–2018 and tested on 2019–2022, with time-respecting cross-validation and models chosen on validation error only. It reached R² 0.86 on the test years, about 1.5 µg/m³ off on average, and beat the "same as 2018" baseline (R² 0.79).
  • An ablation showing the electricity mix adds almost nothing: a control with only year and country scored about the same (R² 0.87). The skill comes from knowing the country and the trend.
  • An Australia 2030 scenario with the team's Oceania model: if fossil fuels fell to 25% of electricity, three models disagreed even on the direction (−1.2 to +0.6 µg/m³), and 25% is outside Australia's historical range, so the effect is small and not reliable.

Team

A team project. My parts were the data cleaning, the Europe model and the Australia 2030 scenario.