Repository navigation
Replies: 1 comment
|
from causalml.inference.meta import BaseTRegressor
from sklearn.ensemble import GradientBoostingRegressor
learner = BaseTRegressor(learner=GradientBoostingRegressor(), control_name=0)
learner.fit(X=X, treatment=treatment, y=y)
te, yhat_c, yhat_t = learner.predict(X, return_components=True)
g = learner.t_groups[0] # the treatment label, e.g. 1
y0 = yhat_c[g] # E[Y | X, T=0]
y1 = yhat_t[g] # E[Y | X, T=g]
# te[:, 0] equals y1 - y0With |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi
I have seen some examples on how to use TLearner for Individual Treatment Effect (ITE) and the outputs represent those values. However, I am going to determine the Y(0)|X and Y(1)|X separately. I am wondering how I can have these two values?
All reactions