{"id":13541022,"url":"https://github.com/rguo12/CIKM18-LCVA","last_synced_at":"2025-04-02T08:31:03.367Z","repository":{"id":79928247,"uuid":"143958653","full_name":"rguo12/CIKM18-LCVA","owner":"rguo12","description":"Code for CIKM'18 paper, Linked Causal Variational Autoencoder for Inferring Paired Spillover Effects.","archived":false,"fork":false,"pushed_at":"2023-01-15T10:53:33.000Z","size":50138,"stargazers_count":14,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-03T06:33:05.679Z","etag":null,"topics":["causal-inference","network-embedding","treatment-effects","variational-autoencoder","variational-inference"],"latest_commit_sha":null,"homepage":"","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/rguo12.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}},"created_at":"2018-08-08T03:55:55.000Z","updated_at":"2023-08-27T03:38:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"f03dad29-4395-4ade-b417-643e62b55fbe","html_url":"https://github.com/rguo12/CIKM18-LCVA","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rguo12%2FCIKM18-LCVA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rguo12%2FCIKM18-LCVA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rguo12%2FCIKM18-LCVA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rguo12%2FCIKM18-LCVA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rguo12","download_url":"https://codeload.github.com/rguo12/CIKM18-LCVA/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246781940,"owners_count":20832937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","network-embedding","treatment-effects","variational-autoencoder","variational-inference"],"created_at":"2024-08-01T10:00:37.542Z","updated_at":"2025-04-02T08:30:58.352Z","avatar_url":"https://github.com/rguo12.png","language":"Python","funding_links":[],"categories":["Other Awesome lists"],"sub_categories":[],"readme":"# CIKM18-Linked Causal Variational Autoencoder\nCode for research paper:\n\n[*Linked Causal Variational Autoencoder for Inferring Paired Spillover Effects*.](https://arxiv.org/abs/1808.03333)\n\nPlease cite us via this bibtex if you use this code for further development or as a baseline method in your work:\n```\n@inproceedings{rakesh2018linked,\n  title={Linked Causal Variational Autoencoder for Inferring Paired Spillover Effects},\n  author={Rakesh, Vineeth and Guo, Ruocheng and Moraffah, Raha and Agarwal, Nitin and Liu, Huan},\n  booktitle={Proceedings of the 27th ACM International Conference on Information and Knowledge Management},\n  pages={1679--1682},\n  year={2018},\n  organization={ACM}\n}\n```\n\nIn this work, we consider spill-over effect between instances for learning causal effects from data.\n\n## Amazon dataset\n\nFor the Amazon dataset we processed and used for the paper, please check out:\n[Download Amazon Dataset Here](https://www.dropbox.com/s/d69tj0xnu3zc9bo/Amazon-CIKM18.zip?dl=0)\n\nWe will use the positive review dataset as an example. You will load data from **new_product_graph_pos.npz** and **AmazonItmFeatures_pos.csv**.\n\nIf you run the following code to load the item-item co-purchase graph **new_product_graph_pos.npz**\n```\nimport pandas as pd\nimport numpy as np\nimport json\nfrom scipy.sparse import csr_matrix\n\nprod_G = np.load(\"new_product_graph_pos.npz\")\nprint(prod_G.files)\ndata = prod_G['data']\nindices = prod_G['indices']\nindptr = prod_G['indptr']\nshape = prod_G['shape']\n\ncsr_mat = csr_matrix((data, indices, indptr), dtype=int)\n\narr = csr_mat.toarray()\n```\nyou will find there is a dimension mismatch: arr.shape is (96132, 42135) while the positive review dataset only has 42135 instances. You will only need the first 42135 rows of the matrix since the rest is just 0s. So it is safe to ignore the rest.\n\nFor the file **AmazonItmFeatures_pos.csv**, you can load it as a pd.Dataframe with the dimension (43135, 305). The last 300 columns are the doc2vec features. The first, second and third columns are the treatment, treated outcome and the controlled outcome. The forth and fifth columns can be ignored.\n\nYou can refer to [this link](https://stackoverflow.com/questions/52299420/scipy-csr-matrix-understand-indptr) for how to handle the csr matrices with indptr.\n\nFor the job training dataset, please refer to the paper.\n\nFeel free to email me ruocheng.guo at cityu dot edu dot hk for any question and collaboration.\n\n\n## Acknowledgement\n\nThe code is developed based on the code released by authors of the Neurips 2017 paper:\n```\nLouizos, Christos, Uri Shalit, Joris M. Mooij, David Sontag, Richard Zemel, and Max Welling. \"Causal effect inference with deep latent-variable models.\" In Advances in Neural Information Processing Systems, pp. 6446-6456. 2017.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frguo12%2FCIKM18-LCVA","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frguo12%2FCIKM18-LCVA","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frguo12%2FCIKM18-LCVA/lists"}