A Causal Inference library for Big Data.
Project description
Reina
About Reina
ReInA (Reasoning In AI) is a causal inference platform aimed at estimating heterogeneous treatment effects in observational data. There are various open-source projects that provide convenient causal inference methods, but the current out-of-box packages are limited to local memory for computation. Hence, this project integrates Apache Spark with various machine learning (ML) powered causal inference frameworks, enabling causal analysis on big-data.
Installation
$ pip install reina
Quick Start
import reina
from pyspark.sql import SparkSession
# Initialize spark session
spark = SparkSession \
.builder \
.appName('Meta-Learner-Spark') \
.getOrCreate()
# Read data locally (without cluster) or from a distributed storage (e.g., Hadoop HDFS, AWS S3)
data = spark.read \
.format("csv") \
.load("your_data.csv") \
# Set up necessary parameters (parameters will vary depending on the method used)
treatment = ['name_of_treatment']
outcome = 'name_of_outcome'
# Setup and fit model
causal_model = reina.iv.TwoStageLeastSquares(data=data, treatment=treatment, outcome=outcome)
causal_model.fit(data=data, treatments=treatment, outcome=outcome,...)
# Get heterogeneous treatment effect
cate, ate = causal_model.effect()
print(cate)
print(ate)
Please refer to example notebooks and full documentation for more detailed toy demonstrations.
Contribution Guidelines
If you wish to contribute, please refer to our contribution guidelines.
Any contributions are greatly welcomed and appreciated.
References
Project details
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
File details
Details for the file reina-0.0.6.tar.gz
.
File metadata
- Download URL: reina-0.0.6.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 093ed4d3b7c588c9d16c790b82e66c6137eb9ba3f3e75ef530c967510404b0e8 |
|
MD5 | 8f397fb9adba1f155e0042bbabf44eb1 |
|
BLAKE2b-256 | b0933a4223e11dd7d4b78d43f068da92a97df8f0a6a38c92c356eaefd98be478 |
File details
Details for the file reina-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: reina-0.0.6-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13d419ca813066d06a886521dd5292a3fe42ca4422306ae60bfbb54a7bf0fb94 |
|
MD5 | e350ec3b8cdf6e8a46f0ad9b5ee4cb5e |
|
BLAKE2b-256 | d8b255d2d215096ef783187b19b1db14d8b87b39104ba2834b152eecce2e2461 |