{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/estimating-counterfactual-treatment-outcomes-1","title":"Estimating Counterfactual Treatment Outcomes over Time Through Adversarially Balanced Representations","arxiv_id":"2002.04083","date":"2020-02-10","proceeding":"ICLR 2020 1","authors":["Ioana Bica","Ahmed M. Alaa","James Jordon","Mihaela van der Schaar"],"abstract":"Identifying when to give treatments to patients and how to select among multiple treatments over time are important medical problems with a few existing solutions. In this paper, we introduce the Counterfactual Recurrent Network (CRN), a novel sequence-to-sequence model that leverages the increasingly available patient observational data to estimate treatment effects over time and answer such medical questions. To handle the bias from time-varying confounders, covariates affecting the treatment assignment policy in the observational data, CRN uses domain adversarial training to build balancing representations of the patient history. At each timestep, CRN constructs a treatment invariant representation which removes the association between patient history and treatment assignments and thus can be reliably used for making counterfactual predictions. On a simulated model of tumour growth, with varying degree of time-dependent confounding, we show how our model achieves lower error in estimating counterfactuals and in choosing the correct treatment and timing of treatment than current state-of-the-art methods.","url_abs":"https://arxiv.org/abs/2002.04083v1","url_pdf":"https://arxiv.org/pdf/2002.04083v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"estimating-counterfactual-treatment-outcomes-1","repo_url":"https://bitbucket.org/mvdschaar/mlforhealthlabpub","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"tf","reach":null},{"paper_slug":"estimating-counterfactual-treatment-outcomes-1","repo_url":"https://github.com/ioanabica/Counterfactual-Recurrent-Network","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"estimating-counterfactual-treatment-outcomes-1","repo_url":"https://github.com/Valentyn1997/CausalTransformer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":null,"task_name":"counterfactual"}],"methods":[{"method_slug":"counterfactuals","method_name":"Counterfactuals"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2002.04083","atlas_url":"https://app.syntology.ai/?focus=2002.04083","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2002.04083"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ioanabica/Counterfactual-Recurrent-Network","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://bitbucket.org/mvdschaar/mlforhealthlabpub","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Valentyn1997/CausalTransformer","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"unverified":6},"by_repo_kind":{"official":{"samples":7,"ran":1,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"6d0986a34107d942","entry":"process_seq_data","repo":"ioanabica/Counterfactual-Recurrent-Network","repo_kind":"official","path":"CRN_decoder_evaluate.py","file_url":"https://github.com/ioanabica/Counterfactual-Recurrent-Network/blob/HEAD/CRN_decoder_evaluate.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6d0986a34107d942"}},{"code_sha256_prefix":"49da0ce0fcbb45b8","entry":"calc_diameter","repo":"ioanabica/Counterfactual-Recurrent-Network","repo_kind":"official","path":"utils/cancer_simulation.py","file_url":"https://github.com/ioanabica/Counterfactual-Recurrent-Network/blob/HEAD/utils/cancer_simulation.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"49da0ce0fcbb45b8"}},{"code_sha256_prefix":"b3ddbda44f74ad61","entry":"calc_volume","repo":"ioanabica/Counterfactual-Recurrent-Network","repo_kind":"official","path":"utils/cancer_simulation.py","file_url":"https://github.com/ioanabica/Counterfactual-Recurrent-Network/blob/HEAD/utils/cancer_simulation.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b3ddbda44f74ad61"}},{"code_sha256_prefix":"15186e50c588f77d","entry":"get_confounding_params","repo":"ioanabica/Counterfactual-Recurrent-Network","repo_kind":"official","path":"utils/cancer_simulation.py","file_url":"https://github.com/ioanabica/Counterfactual-Recurrent-Network/blob/HEAD/utils/cancer_simulation.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"15186e50c588f77d"}},{"code_sha256_prefix":"f8b7195b5d9d50be","entry":"get_mse_at_follow_up_time","repo":"ioanabica/Counterfactual-Recurrent-Network","repo_kind":"official","path":"utils/evaluation_utils.py","file_url":"https://github.com/ioanabica/Counterfactual-Recurrent-Network/blob/HEAD/utils/evaluation_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f8b7195b5d9d50be"}},{"code_sha256_prefix":"786623c0bcd0335a","entry":"get_processed_data","repo":"ioanabica/Counterfactual-Recurrent-Network","repo_kind":"official","path":"utils/evaluation_utils.py","file_url":"https://github.com/ioanabica/Counterfactual-Recurrent-Network/blob/HEAD/utils/evaluation_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"786623c0bcd0335a"}},{"code_sha256_prefix":"51ca65759ce4ce19","entry":"process_counterfactual_seq_test_data","repo":"ioanabica/Counterfactual-Recurrent-Network","repo_kind":"official","path":"CRN_decoder_evaluate.py","file_url":"https://github.com/ioanabica/Counterfactual-Recurrent-Network/blob/HEAD/CRN_decoder_evaluate.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"51ca65759ce4ce19"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}