Time-series forecasting of weekly COVID-19 cases in Zimbabwe using ARIMA and Random Forest, with a comparative analysis of model performance and failure modes.
# COVID-19 Weekly Case Forecasting Zimbabwe
**Author:** Bervely Pangwana
**Tools used:** Python (pandas, numpy, matplotlib), statsmodels (ARIMA), scikit-learn (Random Forest)
## Project Overview
This project forecasts weekly COVID-19 case counts for Zimbabwe using two
different modeling approaches a classic statistical time-series model
(ARIMA) and a machine learning approach (Random Forest with engineered lag
features) and rigorously compares their performance against each other
and a naive baseline.
**Note:** This is a technical forecasting exercise using historical public
health data for skill demonstration. It is not intended for clinical or
policy decision-making.
## Objectives
- Build a time-series forecasting pipeline from raw case data to evaluated predictions
- Apply and compare a classic statistical method (ARIMA) against a machine
learning method (Random Forest with lag features)
- Critically evaluate model performance, including understanding *why* a
model underperforms, not just reporting whether it did
## Data Source
Our World in Data COVID-19 dataset, filtered to Zimbabwe, resampled from
daily to weekly case counts to reduce reporting noise.
## Methodology
1. **Data Preparation:** Filtered global dataset to Zimbabwe, cleaned missing/negative values, resampled daily counts to weekly totals.
2. **Train/Test Split:** Held out the final 12 weeks as a test set (never seen during training).
3. **Baseline:** Naive forecast (next week = last known week) as the benchmark to beat.
4. **Model 1 - ARIMA:** Tested for stationarity (Augmented Dickey-Fuller test), selected the best (p,d,q) order via AIC grid search, fit and forecasted.
5. **Model 2 - Random Forest:** Engineered lag features (previous 4 weeks + rolling mean), trained a Random Forest Regressor, and generated forecasts recursively (each prediction feeds into the next week's input features).
6. **Evaluation:** Compared all three approaches using MAE and RMSE.
## Key Findings
**Model Performance …