I am here to share my issues with C1W2_Assignment Exercise 2 (Back Substitution) and 3 ( The Gaussian Elimination). I solved them, but they still show as failed in the grading section, and a message is displayed saying “Unable to find object required for grading in your code.” If someone could help me, I am stuck here with no further progress for the last four days.
kindly do not post any grade cells code, it is against community guidelines.
Check if you have removed any markers mentioned as GRADE CELL OR #UNQC1 ?
If you are unsure, then get a fresh copy and write codes only between assigned markers ###START AND END CODE HERE ### without deleting any other part of grade cell, and then re submit.
There are some things wrong with the code that you showed in your first post here. Do you pass the tests in the notebook? I’d be surprised given that you are stripping the last element from substitution_row. You don’t need to strip that element because there is the augmented argument to get_index_first_non_zero_value_from_row (or whatever it’s called), right?
You make the same mistake consistently through the rest of the code. These operations affect the full rows including the augmented element, right? When you do Gaussian Elimination, it affects both sides of the equal signs, if you think of it in terms of the original equations.
What do you mean “doesn’t make sense”? You pass the tests in the notebook. What does the grader say?
Note that there is a bug in your code, but it apparently doesn’t matter with the test cases here: why did you remove the augmented = True argument when you called the fancy “get index” function? That was my point in what I said above: that’s how you cope with the fact that the substitution row is augmented.
That’s great news! I was going to say that the most recent code you showed looked correct to me, once you added back the augmented = True parameter on that call (but as we see from experimentation that doesn’t really matter in any case).
Yes, it’s interesting that the augmented=True parameter didn’t make a difference in the outcome. Sometimes, these details can be tricky, but I’m glad everything worked out in the end.
Well, if I’m thinking correctly about this, I think the only case in which the augmented = True case would matter would be if you had a singular system in which all the values in at least one row representing the actual coefficients would be 0 and the augmented value would be the only non-zero value in the row. There’s no solution in that case, so maybe it’s not that surprising that they don’t test that case for back_substitution. The way they had us write the final gaussian_elimination function, we’d never even call back_substitution in the singular case, so it is just a detail that really doesn’t matter. Although they did take the trouble to point it out in the comments they gave us in the template code.