I Built a Tool That Answers “Did This Policy Actually Work?”
Causal inference is notoriously hard to access. I tried to fix that.
I Built a Tool That Answers “Did This Policy Actually Work?”

Causal inference is notoriously hard to access. I tried to fix that.
Most policy decisions get evaluated with vibes.
A company rolls out a new onboarding flow, sees retention go up 12% the next month, and declares victory. A government subsidizes solar panels, installations spike, and the minister takes a victory lap. But correlation is doing all the heavy lifting in both cases. The real question nobody answers rigorously is: compared to what?
That question is the entire field of causal inference. And while the academic tools to answer it exist, getting them running in practice involves either expensive software, R packages that assume a PhD reader, or Python code you have to stitch together from three different papers. I got tired of that gap, so I built CausalLens.
What it actually does
You give CausalLens a time series and an intervention date. It builds a counterfactual: what the metric would have looked like if the intervention never happened. Then it compares that to what actually happened. The gap, with statistical confidence, is your causal estimate.
It supports five methods so you can pick what fits your data:
- ARIMA ITS (Interrupted Time Series) for the straightforward single-series case
- SARIMAX when your data has seasonality you can’t ignore
- Bayesian Structural Time Series for probabilistic, uncertainty-aware estimates
- Difference-in-Differences when you have a control group
- Synthetic Control when your control group needs to be constructed from a weighted combination of other units
Each analysis spits out effect size, p-value, 95% confidence intervals, and downloadable reports in both PDF and interactive HTML formats.

Why I built it this way?
The target user is not a statistician. It’s the product manager asking if the redesign worked, the public health analyst trying to evaluate a regional program, the operations lead trying to justify a process change to leadership. People who understand that correlation is not causation but don’t have the time to become causal inference specialists.
So the whole thing runs on Streamlit Community Cloud’s free tier. No GPU, no server to maintain, no $200/month compute bill. You upload a CSV, pick a method, set a date, and get results in seconds.

What I learned building it?
Synthetic Control is deceptively hard to implement well. The optimization problem (finding the right weights for your donor pool) is sensitive in ways that only become obvious when you test it on messy real-world data. I spent more time on that one method than on everything else combined.
The other thing: writing good uncertainty communication is a UX problem, not just a stats problem. A confidence interval is meaningless to most users if you don’t explain what it means in plain language, in context. The reports now include plain-English summaries alongside the numbers.
Try it / break it / fork it
The app is live: https://causallens-khg4uatpmnhustajhn8mdl.streamlit.app/
The code is fully open source: https://github.com/AshayK003/CausalLens
I’d genuinely love to see what datasets people throw at it. If you find a method that performs poorly on your use case, open an issue. If you want to add a method (Regression Discontinuity is the obvious next one), PRs are open.
Causal inference should not be a luxury reserved for teams with data science PhDs. That’s the whole point.
Star the repo if you like it ;)
메타데이터
- post_id
- 0adc3217a4ef
- slug
- i-built-a-tool-that-answers-did-this-policy-actually-work-0adc3217a4ef
- url
- https://medium.com/@darkcharon3301_96987/i-built-a-tool-that-answers-did-this-policy-actually-work-0adc3217a4ef
- canonical_url
- https://medium.com/@darkcharon3301_96987/i-built-a-tool-that-answers-did-this-policy-actually-work-0adc3217a4ef
- author_url
- https://medium.com/@darkcharon3301_96987
- status
- ok
- fetched_at
- 2026-06-09 15:37:30