I am completely lost in cell UNQ_C9 - how do I # set the treatment estimator?
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!!!
Whoops, I meant C3_W1! Sorry!
This is the code. I just don’t know where to start to set the estimator.
The below instructions tells you to recall the treatment estimator and control estimator according to def init(self, treatment_estimator, control_estimator):
__init__() sets the treatment and control estimators based on the given inputs to the constructor.
So use the same term without self
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.
your code needs a bit correction with the second part of the code,
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
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
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.
Thanks for your help, Deepti!