I am completely lost in cell UNQ_C9 - how do I # set the treatment estimator?
Hello @jimtarrant5,
Can you explain a little more on how to help you with your issue?
Are you getting any error, then kindly share a image of your error without sharing any codes at the public post as it is against community guidelines.
Also you mentioned UNQ_C9 but week 3 has only UNQ_C4 cells to grade?
Can you be a little more specific? probably an image!!!
Regards
DP
Whoops, I meant C3_W1! Sorry!
This is the code. I just don’t know where to start to set the estimator.
Hello @jimtarrant5,
The below instructions tells you to recall the treatment estimator and control estimator according to def init(self, treatment_estimator, control_estimator):
The constructor __init__()
sets the treatment and control estimators based on the given inputs to the constructor.
So use the same term without self
Regards
DP
Thank you for engaging, Deepti. Are you saying it as simple as I have shown below?
It seems the TLearner is still not functioning correctly. Later I get an error when I call the quantile_benefit() function on the results of the Tlearner.
Hello @jimtarrant5,
your code needs a bit correction with the second part of the code,
The predict
function takes the featuers and uses each estimator to predit the risk of death. Then it calculates the risk of death for the control estimator minus the risk of death from the treatment estimator, and returns this as the predicted risk reduction.
Return should be preds (np.array): predicted risk reduction for each row of X
Regards
DP
Thanks, again, Deepti.
The predicted risk reduction is what I intend to return, but the last few lines were cut off in the previous image
Hello @jimtarrant5,
predict the risk of death using the control estimator
risk_control = self.control_estimator.predict_proba(X)(you need to add a code matrix here)
predict the risk of death using the treatment estimator
risk_treatment = self.treatment_estimator.predict_proba(X)(you need to add a code matrix here)
the predicted risk reduction is control risk minus the treatment risk
pred_risk_reduction = don’t use numpy here. just use the arithmetic way.
Regards
DP
Thanks for your help, Deepti!
Issue resolved??