{"id":28517033,"url":"https://github.com/mamba413/causalgraphcut","last_synced_at":"2026-03-07T19:33:18.061Z","repository":{"id":295430240,"uuid":"989976114","full_name":"Mamba413/CausalGraphCut","owner":"Mamba413","description":"Code for “Balancing Interference and Correlation in Spatial Experimental Designs: A Causal Graph Cut Approach”","archived":false,"fork":false,"pushed_at":"2025-05-26T05:06:42.000Z","size":200,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-09T04:39:21.457Z","etag":null,"topics":["causal-inference","double-robust","graph-cut","spatial-covariance-matrix","spatial-data"],"latest_commit_sha":null,"homepage":"https://icml.cc/virtual/2025/poster/43725","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mamba413.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-25T08:34:16.000Z","updated_at":"2025-05-26T05:06:45.000Z","dependencies_parsed_at":"2025-05-26T13:48:19.859Z","dependency_job_id":null,"html_url":"https://github.com/Mamba413/CausalGraphCut","commit_stats":null,"previous_names":["mamba413/causalgraphcut"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mamba413/CausalGraphCut","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mamba413%2FCausalGraphCut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mamba413%2FCausalGraphCut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mamba413%2FCausalGraphCut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mamba413%2FCausalGraphCut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mamba413","download_url":"https://codeload.github.com/Mamba413/CausalGraphCut/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mamba413%2FCausalGraphCut/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30227853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["causal-inference","double-robust","graph-cut","spatial-covariance-matrix","spatial-data"],"created_at":"2025-06-09T04:30:27.435Z","updated_at":"2026-03-07T19:33:18.050Z","avatar_url":"https://github.com/Mamba413.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Balancing Interference and Correlation in Spatial Experimental Designs: A Causal Graph Cut Approach\n---------------\n\nThis repository contains the implementation for the paper \"[Balancing Interference and Correlation in Spatial Experimental Designs: A Causal Graph Cut Approach](https://icml.cc/virtual/2025/poster/43725)\" (ICML 2025) in Python.\n\n### Summary of the paper\n\nThis paper focuses on the design of spatial experiments to optimize the amount of information derived from the experimental data and enhance the accuracy of the resulting causal effect estimator. We propose a surrogate function for the mean squared error of the estimator, which facilitates the use of classical graph cut algorithms to learn the optimal design. Our proposal offers three key advances: (1) it accommodates moderate to large spatial interference effects; (2) it adapts to different spatial covariance functions; (3) it is computationally efficient.\n\n![](figure/m-cut.png)\n\n### Reproduction guidance\n\n- Change your working directory to this main folder, run `setup.sh` to configure the environment and install all requirements.\n- `./figure3b.sh` --\u003e reproduce Figure 3(b)\n- `./figure6.sh` --\u003e reproduce Figure 6\n- `./figure7.sh` --\u003e reproduce Figure 7\n- `./figure8\u00269.sh` --\u003e reproduce Figure 8 and Figure 9\n\n### Using the method\n\n**Warm-up**. If you can assess the _spatial covariance_, then you can employ _oracel_ causal graph cut by following these steps:\n\n```python\n### 1. configure the double robust estimator\nfrom sklearn.ensemble import RandomForestRegressor\nfrom semi_sp_design import SemiEstimator\n\nmodel = RandomForestRegressor(random_state=0, n_estimators=10)\nsemi_est = SemiEstimator(n_splits=2, model=model)\n\n### 2. get spatial clusters by (oracle) causal graph cut\nfrom SemiGraphCut import multi_graph_cut\n\nW = your_env.get_adj_matrix()\nV = your_env.get_cov_matrix()\nspat_cluster, _ = multi_graph_cut(W=W, V=V)\n\n### 3. get the ATE estimation based on the cluster design\nc_design = ClusterDesign(p=0.5, W=W, cluster=spat_cluster)\nsemi_est.update_design(c_design)\nhat_tau_C, _ = semi_est.estimate(your_env, N=100)\nprint(\"Estimator:\", hat_tau_C)\n```\n\n**More realistic cases**. Iteratively estimate spatial covariance via the **causal graph cut** by following these steps:\n\n```python\n### configure the double robust estimator as previous\nfrom sklearn.ensemble import RandomForestRegressor\nfrom semi_sp_design import SemiEstimator\nmodel = RandomForestRegressor(random_state=0, n_estimators=10)\nsemi_est = SemiEstimator(n_splits=2, model=model)\n\n### perform the causal graph cut algorithm\nfrom SemiGraphCut import online_graph_cut\nonline_graph_cut(your_env, semi_est)\nhat_tau_C, _, _ = semi_est.estimate(your_env, N=100)\nprint(\"Estimator:\", hat_tau_C)\n```\n\n### Citation\n\nPlease cite our paper [Balancing Interference and Correlation in Spatial Experimental Designs: A Causal Graph Cut Approach (ICML 2025)](https://icml.cc/virtual/2025/poster/43725)\n\n```\n@inproceedings{zhu2025balancing,\n  title={Balancing Interference and Correlation in Spatial Experimental Designs: A Causal Graph Cut Approach},\n  author={Zhu, Jin and Li, Jingyi and Zhou, Hongyi and Lin, Yinan and Lin, Zhenhua and Shi, Chengchun},\n  booktitle={International Conference on Machine Learning},\n  year={2025},\n  organization={PMLR}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmamba413%2Fcausalgraphcut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmamba413%2Fcausalgraphcut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmamba413%2Fcausalgraphcut/lists"}