Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
Revising setup.py. Also adding support for continuous NWOE and NIV.
Browse files Browse the repository at this point in the history
  • Loading branch information
rsyi committed Oct 29, 2019
1 parent d9d44bd commit f70b8d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pylift/explore/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def _get_counts(df_new, feats, col_treatment='Treatment', col_outcome='Outcome')
trt = df_new[col_outcome]
for feat in feats:
bin_feat = str(feat)+'_bin'
counts1_t1 = df_new[(y==1)&(trt==1)][[feat,bin_feat]].groupby(bin_feat).count().rename(columns={feat:'counts_y1t1'})
counts1_t0 = df_new[(y==1)&(trt==0)][[feat,bin_feat]].groupby(bin_feat).count().rename(columns={feat:'counts_y1t0'})
counts1_t1 = df_new[(y>0)&(trt==1)][[feat,bin_feat]].groupby(bin_feat).count().rename(columns={feat:'counts_y1t1'})
counts1_t0 = df_new[(y>0)&(trt==0)][[feat,bin_feat]].groupby(bin_feat).count().rename(columns={feat:'counts_y1t0'})
counts0_t1 = df_new[(y==0)&(trt==1)][[feat,bin_feat]].groupby(bin_feat).count().rename(columns={feat:'counts_y0t1'})
counts0_t0 = df_new[(y==0)&(trt==0)][[feat,bin_feat]].groupby(bin_feat).count().rename(columns={feat:'counts_y0t0'})
# creating a dataframe with all of these results
Expand Down Expand Up @@ -174,8 +174,8 @@ def _NIV(df_new, feats, col_treatment='Treatment', col_outcome='Outcome'):
y = df_new[col_outcome]
ny0t0 = len(df_new[(y==0)&(trt==0)])
ny0t1 = len(df_new[(y==0)&(trt==1)])
ny1t0 = len(df_new[(y==1)&(trt==0)])
ny1t1 = len(df_new[(y==1)&(trt==1)])
ny1t0 = len(df_new[(y>0)&(trt==0)])
ny1t1 = len(df_new[(y>0)&(trt==1)])

# get overall counts
counts_dict = _get_counts(df_new, feats, col_treatment=col_treatment, col_outcome=col_outcome)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from setuptools import find_packages, setup

setup(name='pylift',
version='0.1.0',
version='0.1.1',
description='Python implementation of uplift modeling.',
author='Robert Yi, Will Frost',
author_email='[email protected]',
url='https://github.com/wayfair/pylift',
url='https://github.com/pylift/pylift',
install_requires=[
'numpy',
'matplotlib',
Expand Down

0 comments on commit f70b8d7

Please sign in to comment.