Week 2 Gaussian elmination row_echelon_form section grading failed

No grader feedback don’t know how to fix it as a result

Do you pass the tests in the notebook? And the grader is only failing for the row_echelon_form function?

I added some print statements in my row_echelon_form function and here’s the output I get when I run the unittest cell for that function in the notebook:

M =
[[1. 0. 0. 0.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]]
Outer loop row = 0
M[0] after 1/pivot =
[1. 0. 0. 0.]
Inner loop row = 1
M[1] after = [0. 1. 0. 0.]
Inner loop row = 2
M[2] after = [0. 0. 1. 0.]
Outer loop row = 1
M[1] after 1/pivot =
[0. 1. 0. 0.]
Inner loop row = 2
M[2] after = [0. 0. 1. 0.]
Outer loop row = 2
M[2] after 1/pivot =
[0. 0. 1. 0.]
M final =
[[1. 0. 0. 0.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]]
M =
[[1. 2. 3. 4.]
 [5. 0. 2. 3.]
 [1. 4. 5. 6.]]
Outer loop row = 0
M[0] after 1/pivot =
[1. 2. 3. 4.]
Inner loop row = 1
M[1] after = [  0. -10. -13. -17.]
Inner loop row = 2
M[2] after = [0. 2. 2. 2.]
Outer loop row = 1
M[1] after 1/pivot =
[-0.   1.   1.3  1.7]
Inner loop row = 2
M[2] after = [ 0.   0.  -0.6 -1.4]
Outer loop row = 2
M[2] after 1/pivot =
[-0.         -0.          1.          2.33333333]
M final =
[[ 1.          2.          3.          4.        ]
 [-0.          1.          1.3         1.7       ]
 [-0.         -0.          1.          2.33333333]]
 All tests passed

yep

I don’t know what this is supposed to indicate? are you saying do this myself? if so where do i put the print statements

I was just trying to give you some concrete results to help with debugging. You’ll have to examine the logic and see where to put the print statements.

Or if that’s too much of a hassle, the other way to debug is to take an input example and work it out with pencil and paper and then compare that to what your code is doing.

I don’t know what it’s doing beyond the problem it didn’t say I got it wrong it said it couldn’t grade it

Are you sure you clicked “Show grader output” to see whatever messages you get from the grader? Please show us a screenshot of the grader output.

Also are you sure you didn’t modify any of the structural stuff in the notebook. E.g. the first few lines of that cell should be:

# GRADED FUNCTION: row_echelon_form

def row_echelon_form(A, B):

If you delete or modify that first comment line, the grader will probably fail.

I added the grade up to here line at the end and it graded it fine, gonna try resubmitting the whole thing with no changes

yep that worked, well that was nonsense

Sorry, I don’t trust the “GRADE UP TO HERE” mechanism and never use it for that reason.

I wasn’t I submitted the full lab, error can’t grade first part 0 don’t pass, tried with grade up to here to see if it gave any indication what issue was, it grades it fine, submit full lab again only removing grade up to here, it grades fine

Well, the evidence is a bit muddled here, but one thing that could be at play here is that it’s not clear that the grader always does a “Save” when you click “Submit”. So if you have made changes to the notebook and click “Submit” before “Save”, then the grader may not be not seeing the same code you are.

Something to keep in mind. Also note that the grader does not need to see your generated output. So the safest and most efficient way to submit is:

Kernel -> Restart and Clear Output
Save
Submit

wouldnt be the save if it was the first section though but i’ll keep the restart thing in mind

I recommend you never use “Grade up to here”. It isn’t reliable on all courses, and throws weird errors.

again the error happened before grade up to here was used and it was only reason I realized submitting again with no changes would fix it

Understood.
I’m just giving some advice that will hopefully prevent future headaches.