Assignment for week 2 Linear Algebra for Machine Learning and Data Science

The notebook is showing “all test pass” for all exercise but I’m not getting any credit for anything. The stated problem for all exercise is “There was a problem compiling the code from your notebook. Details:
name ‘x_1’ is not defined” I went out of my way to create x_1 for exercise 1 and still having the problem. Right now my grade for this assignment is zero even though I’m getting “all test pass” for all exercise

1 Like

Typically this sort of error happens if your code uses global variables that the grader doesn’t provide.

It can also happen if you modify the notebook by adding cells, deleting cells, moving cells around, or other sorts of unexpected modifications.

I think you should go back over your notebook and remove any changes you made other than filling in the required lines of code.

Or you may need to start over with a fresh copy of the notebook. Instructions for this are in the “M4ML Resources FAQ”, you can find it using the forum search tool.

I’m going to move this thread to the appropriate course area, since you put it in “General Discussions”.

1 Like

hmm, so as an experiment on exercise1 I only filled in the spots in the matrix and vector with None values. I did not create any new variables. Still got the same error as before name ‘x_1’ is not defined.

update.

A = np.array([
[2, -1, 1, 1],
[1, 2, -1, -1],
[-1, 2, 2, 2],
[1, -1, 2, 1]

], dtype=np.dtype(float)) 

b = np.array([6, 3, 14, 8], dtype=np.dtype(float))

the error I actually got was “can’t assign to keyword ”

Please post a screen capture image, so I can see the whole context. It seems there is something missing from your text copy-and-paste.

image

That’s all fine as far as it goes.

Note that you can’t submit a partially complete notebook, because any “None” statements that are left will make the grader crash.

When the grader crashes, it gives very confusing error messages.

Is there a way to debug which of my solutions is causing the grader problems ?

Yes, there is a method:

Complete the assignment.

Do not add any extra code, variables, functions, or otherwise modify the notebook in any way other than as instructed. Don’t delete any cells, or move any cells.

Don’t change anything except the parts you are told to modify. If you get error messages, post them here. Do not try to fix errors by further modifying the notebook.

See if your code passes all of the built-in test cases.

Submit it for grading.

If it doesn’t get 100%, post back here and I’ll assist you in other ways.

my solutions are passing the tests but when they go to the grader its failing. I’ll try to look through it again