C1W2 Gaussian Elimination

Hello! please help me to pass first assignment.
I don’t understand why my first exercise is not correct, because I get all test passed. Maybe it is not correct?

w2_unittest.test_reduced_row_echelon_form(reduced_row_echelon_form)
[0. 0. 0.]
[0. 0.]
[0.]
[0.]
All tests passed

1 Like

You posted this under AI Questions, but it would be better to post it under the course specific Q&A. This looks like M4ML C1 W2, so I will move it for you.

Please give us a little more info here: is it a different test in the notebook that fails? Or are you saying that the test in the notebook passes, but the grader fails that function? If so, please show us the actual grader output that you getting.

2 Likes

I’m talking about unit test inside of notebook, which checks your function.

Sure, I can show you result I get after my func.

A = np.array([[1,2,3],[0,0,0], [0,0,5]])
B = np.array([[1], [2], [4]])
reduced_row_echelon_form(A,B)



array([[1. , 2. , 3. , 1. ],
       [0. , 0. , 1. , 0.8],
       [0. , 0. , 0. , 2. ]])
1 Like

I reformatted your output using the “{}” formatting tool to make it easier to read.

Here’s my output for that test cell:

A = np.array([[1,2,3],[0,0,0], [0,0,5]])
B = np.array([[1], [2], [4]])
reduced_row_echelon_form(A,B)
array([[1., 2., 3., 1.],
       [0., 0., 0., 1.],
       [0., 0., 1., 0.]])

As you can see, it’s not the same as your result. So you need to look a bit more closely at what is supposed to happen there and how your logic works.

1 Like

Sure! Thank you for your answer!

Ignore my previous post. Thanks