All tests passed for all exercises, but when running provided code to calculate patients risk reduction , Im receiving the following error, but I didn’t edit the cells:

TypeError Traceback (most recent call last)
in ()
1 # Use the t-learner to predict the risk reduction for patients in the validation set
----> 2 rr_t_val = t_learner.predict(X_val.drop([‘TRTMT’], axis=1))
3
4 print(f"X_val num of patients {X_val.shape[0]}“)
5 print(f"rr_t_val num of patient predictions {rr_t_val.shape[0]}”)

in predict(self, X)
39
40 # the predicted risk reduction is control risk minus the treatment risk
—> 41 pred_risk_reduction = risk_control - risk_treatment
42
43 ### END CODE HERE ###

TypeError: unsupported operand type(s) for -: ‘NoneType’ and ‘NoneType’

Based on the error message you mentioned, I assume that it appears that the variables “risk_control” and “risk_treatment” have not been edited.
The message says that both variables have the None type object.

Firstly, I kindly recommend you review the mentioned part and ensure that the necessary modifications have been made to the variables.

I figured it out, turns out it was indeed a similar solution, problem with how i implemented the predict code. thanks guys, great work @deeplearning.ai