JA
Back to Projects

Portfolio Project

Predicting Air Quality from Wildfire and Weather Data

Built Machine Learning models to evaluate whether AQI prediction is possible from wildfire and weather data alone.

Oct 2025

Overview

This project tested whether wildfire and weather data alone can predict air quality in places the EPA doesn't monitor. My team built six machine learning models (three supervised, three unsupervised) on combined satellite fire detections, hourly weather station readings, and EPA pollutant measurements across the western US in 2022. The Random Forest classifier was the strongest performer at a 0.92 ROC-AUC, and all three clustering methods independently converged on the same three groupings in the data. I owned the weather and air quality data acquisition and cleaning, QA'd the merge pipeline, built the geospatial visualizations, and reviewed both model families.

Problem

Wildfires release particulate matter, carbon monoxide, and nitrogen oxides that travel far beyond the burn, and the health effects run from eye irritation to cardiovascular events. The EPA's answer is the Air Quality Index, but AQI depends on a physical monitoring station being nearby, and those stations typically sit in industrial and densely populated areas. Michigan's Upper Peninsula has one monitor for the entire peninsula. If you live in a rural community downwind of a fire, there is no local reading to tell you whether it's safe to be outside. The people most exposed to wildfire smoke are the ones least likely to be measured.

Approach

The data came from three federal sources that don't naturally join. NASA's FIRMS VIIRS satellite feed gave us 3.4 million fire detections; NOAA's NCEI archive gave us hourly weather station readings, which I pulled programmatically across hundreds of HTTP GET requests and aggregated into a single cleaned file for the eleven western states; EPA's Air Quality System gave us hourly pollutant measurements, which I converted from raw values to AQI using the EPA's per-pollutant formula. We scoped to the western US in 2022 — a year with major fires including California's Mosquito Fire — after the full multi-year pull proved unworkable against the other datasets. Cleaning meant dropping physically impossible readings, enforcing data integrity on state and county codes, and discarding records with no wind data at all, on the reasoning that wind is what actually moves smoke.

Joining the three was the core engineering problem, and the answer was geospatial. We reprojected from latitude/longitude to Web Mercator so we could work in meters, drew a 20km buffer around each fire detection, and treated overlapping buffers within the same six-hour window as one wildfire. Weather and EPA stations were then linked to fires by a 40km buffer overlap — we started at 20km and widened it after too many fires came back unlinked. On that combined dataset we ran K-means, DBSCAN, and hierarchical clustering to look for structure, then logistic regression, k-nearest neighbors, and a Random Forest classifier to predict AQI category, all tuned by grid search under stratified five-fold cross-validation and scored on weighted one-vs-one ROC-AUC to blunt the effect of class imbalance.

Outcome

Random Forest won cleanly at 0.9213 ROC-AUC with a 1.5% standard deviation across folds, ahead of KNN at 0.8236 and logistic regression at 0.7534, and ablation and sensitivity analysis confirmed it wasn't leaning on any single feature — dropping average temperature, one of the top-ranked features, left performance essentially unchanged. The clustering result was the more interesting surprise: three separate methods, tuned independently, all landed on three clusters, and K-means produced two that were substantively meaningful — one keyed to fire intensity, one to metropolitan proximity. Those are natural candidate features for a future supervised model.

The headline accuracy hides the real finding. Our AQI labels were heavily skewed toward "Low," and the confusion matrix is blunt about what that cost: of the high-AQI cases in the test set, the model got zero right. It learned to predict clean air because clean air is what it mostly saw. That failure maps directly onto the ethical problem we started with — monitors are urban, so our training data is urban, so the model is weakest for exactly the rural population it was built to serve, and a false "low risk" reading is the most dangerous error it can make. The fix we identified is physical rather than statistical: use wind speed and direction to model smoke plumes and link fires only to stations actually downwind, instead of to everything within a 40km radius.

View the Code Repository on GitHub

View our Final Written Report

Get in touch.

Available for speaking, podcasts, panels, writing collaborations, and founding PM / co-founder roles. Reach out on LinkedIn, X, GitHub, or Substack.