Skip to main content

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

reina-0.0.6.tar.gz (8.2 kB view hashes)

Uploaded Source

Built Distribution

reina-0.0.6-py3-none-any.whl (11.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page