This project provides a web-based tool for performing Propensity Score Matching (PSM) and Double Machine Learning (DML) on your tabular data. The backend is built with FastAPI, and the frontend uses Streamlit for an interactive user experience.
👉 Check out the live app: https://analyze-cause.onrender.com/
| DML Tab | PSM Tab |
|---|---|
![]() |
![]() |
Above: The Streamlit frontend for uploading data and running PSM or DML analysis.
- Upload CSV data and select columns for analysis.
- Propensity Score Matching (PSM): Estimate ATT and ATE, visualize propensity and outcome distributions, and inspect matched pairs.
- Double Machine Learning (DML): Estimate ATT and ATE using cross-fitting and machine learning models.
- Interactive visualizations for results.
git clone <your-repo-url>
cd causal_inferencecd backend
pip install -r requirements.txtcd ../frontend
pip install -r requirements.txtuvicorn backend.main:app --reloadThe API will be available at http://localhost:8000/api.
streamlit run frontend/app.pyThe app will open in your browser.
- Upload your CSV file using the upload widget.
- Select the analysis tab (PSM or DML).
- Choose the treatment, outcome, and confounder columns.
- Configure analysis parameters as needed.
- Click "Analyze Data" to run the analysis and view results.
backend/
core/
psm.py # PSM logic
dml.py # DML logic
api/
routes.py # FastAPI endpoints
schemas.py # Pydantic schemas
main.py # FastAPI app entrypoint
requirements.txt
frontend/
app.py # Streamlit frontend
requirements.txt
docs/
dml.png # DML tab screenshot
psm.png # PSM tab screenshot
README.md
- Python 3.8+
- See
backend/requirements.txtandfrontend/requirements.txtfor all dependencies.
MIT License

