What it shows
Winter smog in north Indian cities makes people ask whether tomorrow will be worse. A model using yesterday’s pollutant levels, season and weather can give a rough forecast. The project builds one from public daily air quality data and compares it with the rule that tomorrow equals today.
The science
Pollution is strongly autocorrelated: today’s level is a good predictor of tomorrow’s. The persistence model sets tomorrow equal to today, and any real model must beat it. Lag features (values 1 to 3 days back), rolling means and month capture the pattern, while weather such as wind and rain explains sudden drops. Gradient boosting trees can learn non-linear effects.
Materials
Cost: free. Many items come from home or from waste; spare parts such as LEDs, motors and wire are in the store.
- A laptop with Python 3, pandas, scikit-learn, matplotlib
- A public daily air quality data set for a city with PM2.5, PM10, NO2 and AQI over 3 or more years (CSV from an open source)
- Jupyter notebook
- A report template
Safety
For this project: Use only public data and state the source. Do not present your forecast as official advice about health.
Never use mains electricity: power models with cells, batteries or a low-voltage adapter. Sharp and hot tools, flames and lab chemicals need an adult or your teacher beside you. Keep magnets, button cells and small parts away from young children, and wash your hands after making.
All the safety rulesStep by step
12 steps. Do them in order, and test each part before you go on to the next. Write what you notice in a notebook as you go.
Download the data, parse the dates and plot the AQI series for each year to see the winter peaks.
Count missing days and fill short gaps up to 3 days by interpolation, but leave longer gaps empty.
Make lag features for PM2.5 and PM10 for 1, 2 and 3 days, a 7-day rolling mean and month as sine and cosine.
Set the target as the next day’s AQI and drop the rows without a target.
Split by time with the last 6 months as the test period.
Compute the persistence baseline error and the AQI category accuracy (good, moderate, poor and so on).
Train a linear regression and then a GradientBoostingRegressor, comparing mean absolute error.
Plot actual and predicted AQI for the test winter and mark the days that the model got badly wrong.
Check the confusion between categories and note whether the model misses the severe days.
Add wind speed or rainfall data if available and test the improvement.
Write a short function that takes today’s data and prints tomorrow’s predicted category.
Prepare the report with limits and a note on how data quality of sensors affects results.
What you should see
The boosted model reduces the error relative to persistence by roughly 10 to 25 percent and predicts the AQI category correctly about 60 to 75 percent of the time. It tends to miss sharp spikes, a limitation the report must state.
Viva questions
A teacher or a judge will ask how it works. Try to answer each question before you open it, then compare.
1What is a persistence forecast?
Predicting that tomorrow will be the same as today.
2What does a lag feature mean?
A value from an earlier day used as an input for today’s prediction.
3Why is time-based splitting essential?
Random splits would leak future information into the training data.
4Why does the model miss spikes?
Spikes are caused by sudden events like stubble burning or festivals that the inputs do not capture.
Take it further
Add satellite fire-count data for the neighbouring states as a feature and see if autumn spikes become predictable.
Change one thing, measure what happens, and add a table or chart of your readings: that is what turns a model into your own investigation.
Free ebooks for this project
Science projects
Writing a Science Project File
How to write the report, from the cover page to the bibliography
