How to use CausalLift?

There are 2 ways:

  • [Deprecated option] Use causallift.CausalLift class interface

  • [Recommended option] Use causallift.nodes subpackage with PipelineX package

[Deprecated option] Use causallift.CausalLift class interface

Please see the demo code in Google Colab (free cloud CPU/GPU environment):

Open In Colab

To run the code, navigate to “Runtime” >> “Run all”.

To download the notebook file, navigate to “File” >> “Download .ipynb”.

Here are the basic steps to use.

from causallift import CausalLift

""" Step 1. """
cl = CausalLift(train_df, test_df, enable_ipw=True)

""" Step 2. """
train_df, test_df = cl.estimate_cate_by_2_models()

""" Step 3. """
estimated_effect_df = cl.estimate_recommendation_impact()