NQ_C2 (UNIQUE CELL IDENTIFIER, DO NOT EDIT) def lr_model(X_train, y_train):

test cell ex2: do not edit this cell

lr_model_test(lr_model, X_train, y_train)

AssertionError: Not all tests were passed for test_target. Check your equations and avoid using global variables inside the function.

This means your code did not pass all of the tests.

As Tom says, the problem is that your lr_model function has failed some of the test cases. The solution is not to change the test cell, but to figure out where the errors are. I would agree that the error message there is not very helpful in that it really gives you no clue about what the nature of the error is. I’m not familiar with that course, but you should be able to find the source code for that test function lr_model_test to understand what it is doing. You can examine the earlier cells in the notebook to figure out if they are importing that function from another python source file. Then click ā€œFile -> Openā€ and have a look at that file.

Or maybe the tests printed some intermediate messages that would be more informative before that final failure message …

Or maybe we get lucky and someone who is a mentor for that course will be able to give us more specific guidance.

Thanks for your information, I am going to check the file.

Best regards.

jinh

@jnieto

in case if you are still stuck, please share screenshot of the complete error here.

Such type errors usually can happen if you have recalled any codes in previous grade function cell with global variable instead of local variable or hard-coded the implementation, used a different function recall than Auto grader is looking for and lastly some learners have even reported clearing out kernel, reconnect the kernel and re-run of all the codes have also sometimes resolved their issue.

If you are still stuck, then click on my name, then message me screenshots of your code for review.

Good luck debugging!

Regards
DP

1 Like

Hi, thanks for your reply. I solved the problem with clearing out the kernel.

Best regards.

jinh

1 Like