From 0fc453a3704c46cea343c287bedc8244ebfd56b6 Mon Sep 17 00:00:00 2001 From: Robin van Emden Date: Sat, 25 Jul 2020 16:31:58 +0200 Subject: [PATCH] Minor update propensity demo twang demo --- demo/demo_simpsons_paradox_propensity.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/demo/demo_simpsons_paradox_propensity.R b/demo/demo_simpsons_paradox_propensity.R index 8169656..376ec88 100644 --- a/demo/demo_simpsons_paradox_propensity.R +++ b/demo/demo_simpsons_paradox_propensity.R @@ -206,7 +206,7 @@ print(paste("Movie:",round(sum(prop_dt[choice==2]$reward)/nrow(prop_dt[choice==2 # ------------------------------------------------------------------------------------------------------------ # ---------------------------------- Biased policy repaired with estimated prop --------------------------- # ------------------------------------------------------------------------------------------------------------ - +# # if(!require(twang)) install.packages("twang") # # b_dt$choice <- b_dt$choice - 1 @@ -215,7 +215,7 @@ print(paste("Movie:",round(sum(prop_dt[choice==2]$reward)/nrow(prop_dt[choice==2 # b_dt$choice <- b_dt$choice + 1 # # weights <- get.weights(ip, stop.method = "es.mean") -# b_dt$p <- weights +# b_dt$p <- 1 / weights # # f <- formula("reward ~ choice | X.1 + X.2 | p") # @@ -234,5 +234,5 @@ print(paste("Movie:",round(sum(prop_dt[choice==2]$reward)/nrow(prop_dt[choice==2 # # print(paste("Sport:",sum(prop_dt[choice==1]$reward)/nrow(prop_dt[choice==1]))) # 0.6 CTR Sport again, yay! # print(paste("Movie:",sum(prop_dt[choice==2]$reward)/nrow(prop_dt[choice==2]))) # 0.5 CTR Movie again, yay! - +#