Linear Algebra for Machine Learning and Data Science

Hello
I have a problem in Linear Algebra for Machine Learning and Data Science course in week 4 in the Programming Assignment: Application of Eigenvalues and Eigenvectors: Webpage navigation model and PCA ( the last programming assignment) It gives me a zero for all questions even though I am sure of the solutions and I have changed the code more than once for the questions but still zero

Welcome to the discussion forums! Notice that you have filed a course specific question under the general category of “AI Discussions”. You’ll have better luck getting prompt responses if you file things under the correct category. I will use the little “edit pencil” on the title to move the thread to M4ML C1 W4.

When you get 0 points for everything, it typically means that the grader got an exception of some sort while trying to call your functions. That causes the execution to halt and you can’t get partial scores in that case. The first step in figuring this out is to click “Show grader output” and then post a screen shot of that. That gives some clue about the nature of the problem we hope, although it doesn’t always help. But it’s the first step …

A couple other things to note:

  1. There is no point in submitting a partially completed notebook, because you typically get this scenario.
  2. Even if all your tests pass in the notebook, it is still very possible to fail the grader. It means that your code is not “general”: it is somehow specific to the test case in the notebook but fails with a different test case. Ways to do this include referencing global variables or hard-coding dimensions or other assumptions about the input values.

image

Yikes! That file should be there or you couldn’t run the tests in the notebook. Are you sure things run correctly when you do “Cell → Run All” in the notebook?

The most direct fix is for you to delete your notebook file (using File->Open), and use the Lab Help menu and “Get latest version”.

Then you can start over.

Be sure you don’t make any changes to the notebook that are not specifically mentioned in the instructions.

1 Like

Hey all!

What I’ve been seeing in errors like this is that you maybe added imports in any graded cell. This can cause unexpected behavior. In this case, for instance, the autograder doesn’t have access to the w4_unittest.py file, so it can’t import it.

I’d suggest not adding any new import nor importing any library in the graded cells.

Thanks,
Lucas

2 Likes

Thanks, Lucas. Now it all makes sense. Someone gets an error for “w4_unittest not found” because they forgot to run all the previous cells first, so then they add an extra import statement to the graded cell to solve that. Big mistake!

1 Like


see that is the second assignment and still give me zeros but my code is correct

This looks like a different error than last time. The grader error is complaining about “None” occurring. Are you sure that you completed all the portions of the assignment? It typically doesn’t not work to submit to the grader until you have completed all graded portions of the assignment.

Your code threw an exception in the grader, so it can’t complete operation and you get 0 for all sections, even if some of them are correct.

Yes, I just solved all the questions and it was corrected.
Thank you so much

1 Like

can i send you the file to make sure because it’s back giving me zero :sob: :sob:

Yes, I will send you a DM about how to do that.

I have aproblem in the Linear Algebra for Machine Learning and Data Science Course, ( Exercise 1

This exercise involves implementing the elimination method to convert a matrix into row-echelon form. As discussed in lectures, the primary approach involves inspecting the values along the diagonal. If they equate to 00, an attempt to swap rows should be made to obtain a non-zero value.): When I implment it, it passes. But when i submit it for grading, i receive a zero.

{moderator edit - solution code removed}

Are you sure you didn’t hard-code anything in that function? E.g. the number of rows?

Also are you sure that you got 0 for that function from the grader? Or did you get 0 for all your functions? If the latter, then that probably means there is some syntax error in your notebook.

Please show us the actual message you get from the grader (Click “Show grader output”).

Also note that you added in “import” statement to that cell: that should not have been necessary. If you get an error about “np not defined”, it just means you did not run the earlier cells in the notebook first. You must do that every time you restart or reopen any notebook.

1 Like

Yes, i am sure, Here is the message i am facing

In your notebook, did you modify the function definition for row_echelon_form()?
It should look like this:

Thank you so much, Sir, the problem solved.

1 Like

It’s good news that you found the fix. If it really was that you changed the definition of the function, then this is an important lesson: it’s never a good idea to change the definitions of the functions that are given in the template code. :scream_cat: