This is my test

def reduced_row_echelon_form(A, B):
    # mentor edit: code removed

it returns this

is my code correct

Please do not post your code on the forum. That’s not allowed by the Code of Conduct. If a mentor needs to see your code, we will contact you with instructions via a personal message.

I cannot debug your code for you, but I will give three initial hints:
image

  1. Please use the augmented_matrix() function. That’s why it exists.
  2. You’re working too hard. The initial pivot is M[i,i] (i.e. the diagonal element in each row).
  3. The initial column index is just i.

Thanks, and sorry.

If you are stuck on this assignment, I’ll review your code further.

Note that this assignment is extremely tricky and confusing, and DLAI is going to re-write it to address this issue.

Gaussian elimination is not really a critical skill in machine learning. But it’s a popular topic with math instructors.

Thanks I passed the first exercise I will do the rest tomorrow.

:blush:

1 Like

Hi.
Is this the right way to loop over the array above the current array
for j in range(i):
Is the formula messing

Perform the back substitution step using the formula row_to_reduce = None

and is this correct

row_to_reduce = row_to_reduce - (value * M[j+1])

the assignment before it I have only on test left exercise 2

Capture

I passed!!!.

I changed this
(deleted)
To
(deleted)

And for exersise 2 I used (deleted)

Thanks :grin:

That’s great news!

I’ll delete your code from this thread, since posting it isn’t allowed.

Please do not post your code on the forum. That’s not allowed by the Code of Conduct.

If a mentor needs to see your code, we will contact you with instructions.

Sorry sir!! I apologise I thought I could help?

can you pls review my code

Apologies, I was referring to Afzal_Khan_SK’s message, not yours.

:blush: