Causal Bootstrapping utility package
Project description
Causal Assistant
This library is a semi-wrapper around Jianqiao Mao's causalBootstrapping package
(based upon Little et al.'s Causal Bootstrapping paper) to improve the
user-friendliness and performance of the technique when used for general causal de-confounding.
Causal Bootstrapping is a process for improving model robustness in the presence of causal factors (confounders) by iteratively re-weighting samples within a dataset.
For reference on causality, I suggest reading the works of Judea Pearl. To my knowledge, neither of his books on the topic (Causality, The Book of Why) are freely available outside of academia, however Probabilistic and Causal Inference is, and may be a good place to get started.
Usage and Development
- The project has been built with an assumed Python version of 3.12, however earlier and later versions may also work.
- I recommend
uvand virtual environments for dependency management. - Pull requests are welcome for new functionality or fixes!
Basic Usage:
import causal_assistant as ca
# load your feature data
X, y, u = ...
# de-confound the data!
X_dc, y_dc = ca.bootstrap(causal_graph="""X;y;u;X->y;u->X;u->y;""", X=X, y=y, u=u)
Attribution
Some code in this module is derived from the causalBootstrapping library.
If you use this library, please also cite the originating paper:
@article{little2019causal,
title={Causal bootstrapping},
author={Little, Max A and Badawy, Reham},
journal={arXiv preprint arXiv:1910.09648},
year={2019}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file causal_assistant-0.3.0.tar.gz.
File metadata
- Download URL: causal_assistant-0.3.0.tar.gz
- Upload date:
- Size: 220.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be025fb826a47253d539c08b46b49581478aedb61274ef22b4d12f5a81ef4739
|
|
| MD5 |
fed8765074a337d87d35734dafcd165a
|
|
| BLAKE2b-256 |
d5a142799d088b963e69092a57de11b68b17ed6effbe5c35e662d19aab02147e
|
File details
Details for the file causal_assistant-0.3.0-py3-none-any.whl.
File metadata
- Download URL: causal_assistant-0.3.0-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74475bf601bc7cb4622fa18988d81e22caa39b3ff20e2f8c6a252f819ec07241
|
|
| MD5 |
aa7a5cc4cdd8eb6b1bc65615c8e68fbf
|
|
| BLAKE2b-256 |
39dc9432013cd93971f62b13ecef52c9790cb1920cc2d0bf2f5816a23f3c43b2
|