We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.ATE()
Hi @rpryzant
Thank you for sharing your implementation of CausalBERT!
I tried it recently. I created a number of synthetic datasets and I found the results surprising when using the .ATE() method.
The effect was systematically reversed comparing to the expectation.
I went through the code and it seems to me that there's a possible reversed subtraction in the return statement of the .ATE() method:
def ATE(self, C, W, Y=None, platt_scaling=False): Q_probs, _, Ys = self.inference(W, C, outcome=Y) if platt_scaling and Y is not None: Q0 = platt_scale(Ys, Q_probs[:, 0])[:, 0] Q1 = platt_scale(Ys, Q_probs[:, 1])[:, 1] else: Q0 = Q_probs[:, 0] Q1 = Q_probs[:, 1] return np.mean(Q0 - Q1)
According to the original paper Q1 represents the outcome under the treatment (Y|do(T=1)), while Q0 the outcome under no treatment (Y|do(T=0)).
Q1
Q0
We usually define ATE as E[P(Y|do(T=1)) - P(Y|do(T=0))]
The .ATE() method returns np.mean(Q0 - Q1) which seems to be reversed subtraction.
np.mean(Q0 - Q1)
What are your thoughts on this?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi @rpryzant
Thank you for sharing your implementation of CausalBERT!
I tried it recently. I created a number of synthetic datasets and I found the results surprising when using the
.ATE()
method.The effect was systematically reversed comparing to the expectation.
I went through the code and it seems to me that there's a possible reversed subtraction in the return statement of the
.ATE()
method:According to the original paper
Q1
represents the outcome under the treatment (Y|do(T=1)), whileQ0
the outcome under no treatment (Y|do(T=0)).We usually define ATE as E[P(Y|do(T=1)) - P(Y|do(T=0))]
The
.ATE()
method returnsnp.mean(Q0 - Q1)
which seems to be reversed subtraction.What are your thoughts on this?
The text was updated successfully, but these errors were encountered: