Skip to content

Commit

Permalink
fix missing value bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jpansnap committed Nov 14, 2023
1 parent c154afe commit 9ce214c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions causalml/metrics/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ def get_cumlift(
sorted_df["cumsum_ct"] = sorted_df.index.values - sorted_df["cumsum_tr"]
sorted_df["cumsum_y_tr"] = (
sorted_df[outcome_col] * sorted_df[treatment_col]
).cumsum()
).fillna(0).cumsum(skipna=True).astype(float)
sorted_df["cumsum_y_ct"] = (
sorted_df[outcome_col] * (1 - sorted_df[treatment_col])
).cumsum()
).fillna(0).cumsum(skipna=True).astype(float)

lift.append(
sorted_df["cumsum_y_tr"] / sorted_df["cumsum_tr"]
Expand Down

0 comments on commit 9ce214c

Please sign in to comment.