What this research found
K-Dense merged a full year of EPA county-level air quality readings with Census population estimates, then trained a gradient-boosted classifier to predict whether a given county-day would fall into the Good, Moderate, or Unhealthy AQI band. The model reached 79.6% accuracy, and a parallel PubMed sweep grounded the pollutants it tracks in the respiratory-health literature.
- Yesterday's air quality is overwhelmingly the best predictor of today's. The one-day AQI lag alone carries 59% of the model's feature importance, and the three lag features together account for 78%.
- The classifier reached 79.6% accuracy on 64,617 held-out county-days against a 33% random-chance baseline, with a weighted F1 of 0.76.
- Rare unhealthy days stay hard to catch: recall is just 15% for the AQI > 100 class, which is only 0.4% of the test set, even though the model separates that class well by ROC AUC (0.92).
- Air quality is strongly seasonal, averaging an AQI of 52.4 in summer against 39.1 in winter — a 34% gap that peaks in July.
- The problem concentrates geographically. California holds 7 of the 10 worst counties by mean AQI, led by Riverside (93.6) and San Bernardino (89.9), while state population correlates only moderately with AQI (r = 0.32).
How it was done
EPA's 2023 daily AQI file — 325,399 county-day records — was merged with Census state population estimates at a 99.7% match rate. The feature set combined three days of lagged AQI, month, day of week, season, encoded state and county, and population. An XGBoost classifier was trained on a time-ordered 80/20 split so that no future observations leaked into training. A separate step queried PubMed for 2020–2025 studies tying PM2.5 and ozone to asthma and COPD, and the findings were compiled into a 13-page illustrated report.
Data sources
- EPA Air Quality System — daily AQI by county, 2023 (325,399 records)
- US Census Bureau — 2023 state population estimates
- PubMed — 36 papers screened, 10 synthesized (2020–2025)
Limitations
The model forecasts only one day ahead and depends on having recent AQI readings to do it. It includes no meteorological variables, and the severe class imbalance leaves genuinely unhealthy days under-detected.
Figures from this analysis
Outputs produced
- 26 MB
daily_aqi_by_county_2023.csv
Raw EPA AQI daily data for 2023 by county (325,399 rows)
NST-EST2023-ALLDATA.csv
US Census Bureau state population estimates for 2023
aqi_population_merged.parquet
Merged AQI and population data (325,399 rows × 12 columns)
01_data_acquisition.py
Data acquisition and preprocessing script
pollutant_stats.csv
Summary statistics for 5 pollutants (count, mean, median, std, min, max)
top_10_counties.csv
Top 10 counties by average AQI with state and observations
seasonal_stats.csv
Monthly and seasonal average AQI with observation counts
population_analysis.csv
State-level AQI, population, quartiles, and correlation statistics
How this research was produced
K-Dense Web planned and ran this environment investigation end to end — gathering the sources, carrying out the analysis, producing the figures, and drafting the report. The full session transcript, including every intermediate step, is available to view.


