{"id":19311174,"url":"https://github.com/forestry-labs/causaltoolbox","last_synced_at":"2025-04-22T14:30:32.170Z","repository":{"id":122463329,"uuid":"326802500","full_name":"forestry-labs/causalToolbox","owner":"forestry-labs","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-20T17:22:26.000Z","size":38762,"stargazers_count":41,"open_issues_count":7,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T00:35:23.335Z","etag":null,"topics":["bayesian-additive-regression-trees","causal-inference","inference","interpretability","machine-learning","random-forest","treatment-effects"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forestry-labs.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-04T20:40:38.000Z","updated_at":"2025-01-30T09:11:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"020d5253-3603-4318-a78a-cde2e081a380","html_url":"https://github.com/forestry-labs/causalToolbox","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/forestry-labs%2FcausalToolbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forestry-labs%2FcausalToolbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forestry-labs%2FcausalToolbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forestry-labs%2FcausalToolbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forestry-labs","download_url":"https://codeload.github.com/forestry-labs/causalToolbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250258745,"owners_count":21400961,"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":["bayesian-additive-regression-trees","causal-inference","inference","interpretability","machine-learning","random-forest","treatment-effects"],"created_at":"2024-11-10T00:28:01.011Z","updated_at":"2025-04-22T14:30:32.165Z","avatar_url":"https://github.com/forestry-labs.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"`causalToolbox` provides functions for estimating heterogenous treatment effects.\n\n## How to install\n\nThe latest development version can be installed directly from Github using [devtools](https://github.com/hadley/devtools):\n\n```R\nif (!require(\"devtools\")) install.packages(\"devtools\")\ndevtools::install_github(\"forestry-labs/causalToolbox\")\n```\n\nThe package contains compiled code, and you must have a development environment to install the development version. (Use `devtools::has_devel()` to check whether you do.) If no development environment exists, Windows users download and install [Rtools](https://cran.r-project.org/bin/windows/Rtools/) and macOS users download and install [Xcode](https://itunes.apple.com/us/app/xcode/id497799835).\n\n\n## Example\n\nFor details please read our paper: https://arxiv.org/pdf/1706.03461.pdf\nThis example will not execute because there is no data.\n\n```R\nlibrary(causalToolbox)\npackageVersion(\"causalToolbox\")\n\n# create example data set\nsimulated_experiment \u003c- simulate_causal_experiment(\n    ntrain = 1000,\n    ntest = 1000,\n    dim = 10)\n    \nfeature_train \u003c- simulated_experiment$feat_tr\nw_train \u003c- simulated_experiment$W_tr\nyobs_train \u003c- simulated_experiment$Yobs_tr\n\n# create the hte object using honest Random Forests (RF)\nxl_rf \u003c- X_RF(feat = feature_train, tr = w_train, yobs = yobs_train)\n\n# alternatively, use BART instead of honest Random Forests. If you are not going\n# to be careful about hyperparemeter tuning, we suggest using BART.\nxl_bart \u003c- X_BART(feat = feature_train, tr = w_train, yobs = yobs_train)\n\n# estimate the CATE\nfeature_test \u003c- simulated_experiment$feat_te\n\ncate_esti_rf \u003c- EstimateCate(xl_rf, feature_test)\ncate_esti_bart \u003c- EstimateCate(xl_bart, feature_test)\n\n# evaluate the performance\ncate_true \u003c- simulated_experiment$tau_te\nmean((cate_esti_rf - cate_true) ^ 2)\nmean((cate_esti_bart - cate_true) ^ 2)\n\n# Create confidence intervals via bootstrapping. Note that honest Random\n# Forests have theoretically valid CIs, BART does not. However, BART often\n# performs well for prediction without extensive tuning. See our paper\n# (https://arxiv.org/abs/1706.03461)\n\n# do not run (takes a long time)\nxl_ci_rf \u003c- CateCI(xl_rf, feature_test, B = 500)\nxl_ci_bart \u003c- CateCI(xl_bart, feature_test, B = 500)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforestry-labs%2Fcausaltoolbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforestry-labs%2Fcausaltoolbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforestry-labs%2Fcausaltoolbox/lists"}