I have an error in Programming Assignment: Collaborative Filtering Recommender Systems

I have an error in Programming Assignment: Collaborative Filtering Recommender Systems like Comment line with index: UNQ_C1 wasn’t found in code what i have to do

1 Like

Most likely you have accidentally deleted the line of code that included the UNQ_C1 tag.

2 Likes

I’m having the same error:

Repeated error when attempting to grade lab assignment: “Code Cell UNQ_C1 failed: cofi_cost_func test 1 failed
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.
This dependency may be the cause of the errors.”

The UNQ_C1 is fine and there are no errors in function. This may be a potential error with the grading system. If a mod DM’s me I can provide my code to prove that I am calculating the function properly.

I’ve tried a long list of troubleshooting as well. Any help would be appreciated as I can not complete the course for my certificate.

1 Like

It’s very unlikely to be an issue with the grading system.

Is it possible that you may have done any of these issues?

  • Deleted a cell and then tried to restore it?
  • Added new cells to the notebook?
  • Downloaded the notebook to some other platform, and then uploaded it back to Coursera for grading?

Hi @TMosh thank you for your response. I have done one of those things you described. I’d be happy to dm you the code I’m using since we can’t post.

1 Like

The fix for this situation is to delete your notebook, get a fresh copy, and start over.

I have deleted the notebook but now when I go to enter the lab from my course assignment it does not recreate the lab assignment with all of the necessary cells.

How can I recreate the lab assignment?

1 Like

I just DM’d @TMosh a sample of the code

1 Like

The procedure is:

  • Use the File - > Open menu to delete your old notebook (click on the checkbox next to the ipynb file name, then click on the red “trash can” icon).
  • Then you use the “Help → Get latest version” tool.
  • Then from the “File → Open” menu, you double-click on the notebook file name.
    You may have to refresh your browser at some point.
    This will open the notebook for editing in your browser.

@TMosh After deleting my notebook and recreating it using the above instructions I was able to resolve this issue. I also implemented the hints provided in the lab instruction as regularization was causing an issue.

Thank you for your help!

1 Like

That’s good news. Thanks for your report.

dear I have the same issue, how to resolve it. my week 2 cannot be complete because of only this assignment. Kindly help me in this

1 Like

Code Cell UNQ_C1 failed: cofi_cost_func test 1 failed
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.
This dependency may be the cause of the errors.
same issue I am facing

1 Like

Sir, I also having the same issue from last week. I followed your instructions and again having the same issue. my code is correct in UNQ_C1
this error comes from one non-editable cell

AssertionError Traceback (most recent call last)
in
1 # Public tests
2 from public_tests import *
----> 3 test_cofi_cost_func(cofi_cost_func)

~/work/public_tests.py in test_cofi_cost_func(target)
13
14 J = target(X_r, W_r, b_r, Y_r, R_r, 2);
—> 15 assert not np.isclose(J, 13.5), f"Wrong value. Got {J}. Did you multiply the regularization term by lambda_?"
16 assert np.isclose(J, 27), f"Wrong value. Expected {27}, got {J}. Check the regularization term"
17

AssertionError: Wrong value. Got 13.5. Did you multiply the regularization term by lambda_?
How o solve this issue because the lab having only one exercise and I am getting failed again and again. Please help

1 Like

Hi @Sana_Ullah2 ,

Use the ‘Click for Hints’ link located just below the code cell for the cofi_cost_func() and follow the pseudo code as outlined there and check if you have implemented the code correctly.

1 Like

You’re getting an error because the “non-editable” cell is a function that tests your code. If your code gives the wrong results, you get an error message.

Thank you sir for your assistance, now all tests passed :blush:

1 Like

Thank you sir, its done now

1 Like

I am having major issues with the same lab. Encountered the same issues as above, and none of the solutions worked, so I followed instructions in another thread that suggested deleting the lab file. I did that and now I get a 404 error whenever I try to access the lab. Can someone help? I’ve been stuck on this same lab for almost 2 months, it’s very frustrating as I can’t finish this course. I have also contacted Coursera support but they haven’t been able to help.

1 Like

I recommend not waiting two months to ask for help.

The 404 means you deleted or renamed the original notebook, and the Jupyter environment cannot find the file it is looking for.

To get a fresh copy of the assignment notebook, use this procedure:

  • From the Help menu, use “Get latest version”.
  • From the File menu, open the notebook file that was just installed. It will have the original notebook file name.
  • Go to the Kernel menu, and use “Restart and clear output”.

Now you should be able to begin working on the assignment.