{"id":31108716,"url":"https://github.com/Open-All-Scale-Causal-Engine/OpenASCE","last_synced_at":"2025-09-17T06:45:39.058Z","repository":{"id":211054231,"uuid":"728051301","full_name":"Open-All-Scale-Causal-Engine/OpenASCE","owner":"Open-All-Scale-Causal-Engine","description":"OpenASCE (Open All-Scale Casual Engine) is a Python package for end-to-end large-scale causal learning. It provides causal discovery, causal effect estimation and attribution algorithms all in one package.","archived":false,"fork":false,"pushed_at":"2024-01-19T09:06:09.000Z","size":8239,"stargazers_count":55,"open_issues_count":0,"forks_count":7,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-05-22T04:37:28.165Z","etag":null,"topics":["causal-inference","causality","machine-learning","treatment-effects"],"latest_commit_sha":null,"homepage":"https://openasce.openfinai.org/en-US","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Open-All-Scale-Causal-Engine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-12-06T05:54:36.000Z","updated_at":"2024-05-21T08:17:25.000Z","dependencies_parsed_at":"2023-12-25T09:53:18.974Z","dependency_job_id":null,"html_url":"https://github.com/Open-All-Scale-Causal-Engine/OpenASCE","commit_stats":null,"previous_names":["open-all-scale-causal-engine/openasce"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Open-All-Scale-Causal-Engine/OpenASCE","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-All-Scale-Causal-Engine%2FOpenASCE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-All-Scale-Causal-Engine%2FOpenASCE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-All-Scale-Causal-Engine%2FOpenASCE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-All-Scale-Causal-Engine%2FOpenASCE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Open-All-Scale-Causal-Engine","download_url":"https://codeload.github.com/Open-All-Scale-Causal-Engine/OpenASCE/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-All-Scale-Causal-Engine%2FOpenASCE/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275548995,"owners_count":25484678,"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","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","causality","machine-learning","treatment-effects"],"created_at":"2025-09-17T06:45:23.413Z","updated_at":"2025-09-17T06:45:39.043Z","avatar_url":"https://github.com/Open-All-Scale-Causal-Engine.png","language":"Python","funding_links":[],"categories":["🚀 GitHub Repositories"],"sub_categories":["🌟 **Real-World Magic**"],"readme":"# OpenASCE: A Python Package for End-to-End Large Scale Causal Learning\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE)\n\nOpenASCE (Open All-Scale Casual Engine) is a comprehensive, easy-to-use, and efficient end-to-end large-scale causal learning system. It provides causal discovery, causal effect estimation, and attribution algorithms all in one package.\n\n![OpenASCE Algorithms](docs/img/algo.png)\n\nThe first version already supports the following features:\n\n1. [Two causal discovery algorithms](docs/core/en/discovery/causal_discovery.md): one search-based method and one continuous optimization-based method.\n2. 15+ Casual effect estimation methods and causal debiasing methods\n   - [5 classical causal effect estimation methods](docs/core/en/inference/classical_methods.md). As [EconML](https://github.com/py-why/EconML) already has nice implementations of these methods, we directly integrate them into our package.\n   - [2 SOTA gradient boosting causal tree methods](docs/core/en/inference/causal_trees.rst): GBCT and DiDTree. These algorithms leverage historical outcomes to address potential confounding bias and provide more reliable and unbiased estimates of treatment effects. We implemented time-consuming operators in C++ to speed up the computation.\n   - [9 causal representation learning methods](docs/core/en/extension/debias.md). These methods are based on neural networks and can be used for causal effect estimation or debiasing in recommender systems.\n3. [Causal attribution method with Bayesian rule](docs/core/en/attribution/attribution.md). Given an outcome, the attribution method can provide a rule set that contains the most possible conditions that lead to the given outcome.\n\nIn future versions, we will provide the following features:\n\n1. The distributed version of all algorithms, especially for causal tree methods, search-based discovery methods, and attribution methods.\n2. More methods, especially for causal representation learning methods and tree-based methods.\n\nCompared to other open-source causal inference libraries, OpenASCE has the following advantages:\n\n1. **Large-Scale and High Performance**: OpenASCE is optimized for large-scale causal learning tasks. The distributed version* of causal tree methods can handle datasets with hundreds of millions of samples.\n2. **Extensive algorithms**: OpenASCE provides 20+ industrial-grade algorithms, including 10+ causal representation learning algorithms and 6+ innovative algorithms.\n3. **Full-cycle**: OpenASCE provides a full-cycle causal learning pipeline, including causal discovery, causal effect estimation, and attribution.\n4. **Easy to use**: OpenASCE is designed with a simple interface that allows users to easily run their experiments. It also provides detailed documentations with usage examples.\n\n\\* The distributed version will be released later.\n\n## Getting Started\n\n### Installation\n\nUsers can install OpenASCE with pip or building from the source code.\n\n### Linux\n\nFor Linux (x86_64) with Python 3.11, the pre-built wheel is uploaded to PyPI (Python Package Index), and users could simply install it as follows. More platforms will be supported later.\n\n```bash\npip install openasce\n```\n\n### Other Platforms\n\nFor other platforms, users can install from the source code as follows.\n\n```bash\ngit clone https://github.com/Open-All-Scale-Causal-Engine/OpenASCE.git\ncd OpenASCE\npip install .\n```\n\nAfter the installation, you can use all the algorithms except causal tree algorithms. Detailed instructions can be found in the [installation](docs/core/en/install.md) documentation.\n\n### Usage Examples\n\n#### Causal Discovery\n\n```python\nfrom openasce.discovery import CausalSearchDiscovery\n\ncs = CausalSearchDiscovery()\ncs.fit(X, delimiter=\",\", dtype=int) # X -\u003e data\n(g, s) = cs.get_result()\nprint(f\"score={s}\")\nedges = [(p, c) for c, y in g.parents.items() for p in y]\nprint(f\"edge num={len(edges)}\")\n```\n\n#### Causal Effect Estimation\n\n```python\nfrom openasce.inference.tree import GradientBoostingCausalRegressionTree\n\nm = GradientBoostingCausalRegressionTree(n_period=8, treat_dt=7, coeff=0.5)\nm.fit(X, Y, T) # X -\u003e data, Y -\u003e targets including historical outcomes, T -\u003e treatment\ntau_hat = m.effect(X_test)\nleaf_ids = m.predict(features[te_idx], 'leaf_id')\n```\n\n#### Causal Debiasing Algorithms\n\n```python\nimport tensorflow as tf\nfrom openasce.extension.debias import DMBRDebiasModel\nfrom sklearn.metrics import roc_auc_score\n\ntrain_dataset, test_dataset = get_dataset()\nmodel = DMBRDebiasModel(params) # params specifying the training parameters\nmodel.fit(Z=train_dataset, num_epochs=10)\nmodel.predict(Z=test_dataset)\nresult = model.get_result()\nscores = tf.sigmoid(result[\"logits\"])\nout_auc = roc_auc_score(result[\"labels\"], scores)\nlogger.info(\"auc: {:.4f}\".format(out_auc))\n```\n\n#### Attribution\n\n```python\nfrom openasce.attribution import Attribution\nfrom openasce.discovery import CausalGraph\nfrom openasce.inference import GraphInferModel\n\n# The inference model used in the attribution\ngi = GraphInferModel()\ngi.graph = g # the graph learned by the causal discovery method\ngi.treatment_name = CausalGraph.DEFAULT_COLUMN_NAME_PREFIX + str(7)\ngi.label_name = CausalGraph.DEFAULT_COLUMN_NAME_PREFIX + str(1)\n\nattr = Attribution(threshold=0.1, max_step=2)\n# Set the inferencer to attribution model\nattr.inferencer = gi\nattr.attribute(X=X, treatment_value=1, label_value=1)\nresult = attr.get_result()\nprint(result)\n```\n\nThe complete examples can be found in the [examples](examples/) folder.\n\n## Documentation\n\nDocumentation is available at: \u003chttps://openasce.readthedocs.io/en/latest/index.html\u003e\n\n## How to Contribute\n\nPlease refer to [CONTRIBUTION.md](docs/core/en/contribution.md) for details.\n\n## References\n\n[1] Zheng, X., Aragam, B., Ravikumar, P., \u0026 Xing, E. P. (2018). [DAGs with NO TEARS: Continuous optimization for structure learning](https://dl.acm.org/doi/10.5555/3327546.3327618) Advances in Neural Information Processing Systems (Vol. 31, pp. 9472–9483).\n\n[2] Zheng, X., Dan, C., Aragam, B., Ravikumar, P., \u0026 Xing, E. P. (2020). [Learning sparse nonparametric DAGs](http://proceedings.mlr.press/v108/zheng20a.html) International Conference on Artificial Intelligence and Statistics, 3414–3425.\n\n[3] Tang, C., Wang, H., Li, X., Cui, Q., Zhang, Y.-L., Zhu, F., Li, L., \u0026 Zhou, J. (2022). [Debiased Causal Tree: Heterogeneous Treatment Effects Estimation with Unmeasured Confounding](https://proceedings.neurips.cc/paper_files/paper/2022/hash/2526d439030a3af95fc647dd20e9d049-Abstract-Conference.html). Advances in Neural Information Processing Systems 36, 16.\n\n[4] Tang, C., Wang, H., Li, X., Qing, C., Li, L., \u0026 Zhou, J. (2023). [Difference-in-Differences Meets Tree-Based Methods: Heterogeneous Treatment Effects Estimation with Unmeasured Confounding](https://dl.acm.org/doi/10.5555/3618408.3619815). Proceedings of the 40th International Conference on Machine Learning.\n\n[5] Fang, J., Cui, Q., Zhang, G., Tang, C., Gu, L., Li, L., Gu, J., Zhou, J., \u0026 Wu, F. (2023). [Alleviating Matching Bias in Marketing Recommendations](https://doi.org/10.1145/3539618.3591854). Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval, 3359–3363.\n\n[6] Ding, Y., Zhou, J., Cui, Q., Wang, L., Zhang, M., \u0026 Dong, Y. (2023). [DistriBayes: A Distributed Platform for Learning, Inference and Attribution on Large Scale Bayesian Network](https://doi.org/10.1145/3539597.3573028). Proceedings of the Sixteenth ACM International Conference on Web Search and Data Mining, 1184–1187.\n\n[7] Zhou, J., Tang, C., Cui, Q., Ding, Y., Li, L., \u0026 Wu, F. (2023). [DGBCT: A Scalable Distributed Gradient Boosting Causal Tree at Alipay](https://doi.org/10.1145/3543873.3584645). Companion Proceedings of the ACM Web Conference 2023, 447–451.\n\n## License\n\n[Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpen-All-Scale-Causal-Engine%2FOpenASCE","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpen-All-Scale-Causal-Engine%2FOpenASCE","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpen-All-Scale-Causal-Engine%2FOpenASCE/lists"}