Hi,
I am trying to solve the week 2 graded assignment (Exercise 1) for “Linear Algebra for Machine Learning and Data Science”. I am getting the error Wrong output for test case check_identity_matrix.
Expected:
[[1. 0. 0. 0.]
[0. 1. 0. 0.]
[0. 0. 1. 0.]].
Got:
None.
Wrong output for test case check_matrix_1.
Expected:
[[ 1. 2. 3. 4. ]
[-0. 1. 1.3 1.7 ]
[-0. -0. 1. 2.33333333]].
Got:
None.
Is there anyway to check where the "None" value is coming from?
Sorry if this seems like I’m just stating the obvious, but it’s coming from your code. There must be some place in that function where there’s a return statement and a path to get there such that the value being returned is None. Have you examined all the code paths in the function in question with that thought in mind?
One more detailed point to make:
There are a number of places in the template code where they use None as a “placeholder” for places that you need to fill in with the correct code. E.g. here are a few lines from the template code:
### START CODE HERE ###
# Transform matrices A and B into the augmented matrix M
M = augmented_matrix(None,None)
Everyplace you see None in the code, you need to replace that with the real code. Are you sure you didn’t miss some places that needed to be replaced in that way?