~/work/W1A1/test_utils.py in multiple_test(test_cases, target)
121 print(‘\033[92m’, success," Tests passed")
122 print(‘\033[91m’, len(test_cases) - success, " Tests failed")
→ 123 raise AssertionError(“Not all tests were passed for {}. Check your equations and avoid using global variables inside the function.”.format(target.name))
AssertionError: Not all tests were passed for lr_ARR_quantile. Check your equations and avoid using global variables inside the function.
can you confirm once if you have passed all the test before exercise 6? especially from exercise 3 and 4. Please share screenshot of those two grade functions too by personal DM. I will go through all 3 grade functions and reply back.
for code line
Calculate the baseline risks (use the function that you just implemented)
The hint in bracket mentions you to use the function you just implemented i.e. from exercise 5, you have used lr_predict.proba function which you were not suppose to use here. You require to use the def function name of exercise 5 for baseline risks to the dataframe.copy using the deep=True method to logistic regression model(use the assigned loca argument in the exercise 5)
next code line, I suppose it might be mistype, because you use pd.qcut as the instructions below the exercise 5 header mention you to use pd.cut. Also you do not require to use label as well as duplicate argument here.
next for code lines select the subset of who did receive and did not recieve treatment requires you to dataftame function to the TRTMT and mention the false and true method based on the condition and also don’t forget to specify the its position with : to the df.loc method.
Also when you calculating the true outcome, mention y as [y] is create string list, so kindly use only y.mean
For code line
Set the index of the arr_by_risk_group dataframe to the average baseline risk of each risk group
You actually complicated the codes. You just had to use the df.groupby function to the risk group and to the baseline_risk.mean. I suppose the instruction set the index confused you here. also remember baseline_risk here is not a string list as I mentioned earlier.
You didn’t required to take separate arr_by_risk_group for baseline risk. you basically hard coded the path here.
You codes for exercise 3 and 4 are perfectly fine, and reason I wanted to see exercise 6 code was I noticed you are implementing the treatment condition state differently, so just wanted to confirm it as per autograder.
Remember your codes are incorrect but not as per the autograder, see your error log which mentions you have globa variables instead of local variables.