13

def dmldid_rc(

df, y1_col, y0_col, d_col, X_cols,

ps_model=LogisticRegressionCV(cv=5, random_state=333, penalty="l1", solver="saga"),

l1k_model=LassoCV(cv=5, random_state=333),

) -> np.float:

K = 2

df_set = train_test_split(df, random_state=0, test_size=0.5)

thetabar = []

for i in range(K):

k = 0 if i == 0 else 1

c = 1 if i == 0 else 0

ps_model.fit(df_set[c][X_cols], df_set[c][d_col])

eps = 0.03

ghat = np.clip(

ps_model.predict_proba(df_set[k][X_cols])[:, 1],

eps,

1 - eps,

)

DMLDID for repeated outcomes

cross-ﬁtting

propensity socre