Skip to content
Unified Bharat: Cross-Sector Policy Analytics Lakehouse Dashboard
Back to Projects

Unified Bharat: Cross-Sector Policy Analytics Lakehouse

Distributed Medallion Lakehouse integrating cross-ministry CSR, groundwater, and education datasets using Apache Spark and Iceberg for panel regression analysis of Indian state-level policy outcomes.

Problem

Indian state policy outcomes are scattered across ministry silos: CSR spending lives in Ministry of Corporate Affairs filings, groundwater quality in Jal Shakti station measurements, and educational capacity in Ministry of Education data. Each dataset uses different identifiers, granularities, and quality standards, so asking whether state-level CSR spending associates with groundwater outcomes requires assembling and reconciling them by hand.

Approach

  1. Ingested five government sources — CSR spending (28,834 rows), groundwater quality (188,209 rows), educational institutions (2,141 rows), LGD master codes, and population estimates — into a raw Bronze layer.

  2. Applied a Medallion architecture on Apache Iceberg (Bronze → Silver → Gold) with PySpark on Docker, aggregating to state-year granularity and filtering for quality.

  3. Assembled a unified panel of ~300 rows with derived features (lagged CSR spending, per-capita normalizations, a 0–4 contamination index) for two-way fixed-effects regression.

  4. Benchmarked OLS against Random Forest and XGBoost with 5-fold cross-validation instead of trusting a single model family.

Outcome

99.88%

Data reduction

245K+ raw rows distilled to ~300 unified panel rows through intentional aggregation and quality filtering

RMSE 0.811

Best model

Random Forest beat OLS and XGBoost on 5-fold CV — evidence of non-linear CSR–environment relationships

51%

Top predictor

monitoring-station count, with lagged CSR spending at 21% and institutional capacity at 18.8%

Pipeline

Unified Bharat: Cross-Sector Policy Analytics Lakehouse — pipeline overview (Mermaid, rendered at build time)

Evaluation

Random Forest's win over OLS (RMSE 0.811 on 5-fold CV) is the key finding: it suggests the relationship between CSR spending and environmental outcomes is non-linear, which a textbook fixed-effects specification would miss. Feature importance is best read as correlation given the observational design — monitoring-station count (51%) likely proxies enforcement intensity as much as monitoring itself.

What I'd Do Differently

The lakehouse was over-engineered for the final dataset — 99.88% reduction means most of the infrastructure existed to shrink a problem that a few well-written pandas pipelines could have handled. The Iceberg layer did pay off for reproducibility, but I would right-size the stack to the analysis earlier. I would also add explicit causal framing from day one: the panel answers association questions cleanly, but difference-in-differences would have taken the policy claim further.

Tech Stack

Python
Apache Spark
Apache Iceberg
Docker
PySpark
Panel Regression

Building something similar?

Let's talk

Related Projects