Grading issue on Week 1 Assignment Exercise 9

I received the Expected Output for Exercise 9: Frequency of Classes:

The frequencies for each class are {'spam': 1368, 'ham': 4360}

The proportion of spam in the dataset is: 23.88%

The proportion of ham in the dataset is: 76.12%

Expected Output

The frequencies for each class are {'spam': 1368, 'ham': 4360}

The proportion of spam in the dataset is: 23.88%

The proportion of ham in the dataset is: 76.12%

However, I received a 0 out of 10 on the grading for the class_frequencies function and the grader output says:

There was a problem grading your submission. Details:
0

Can I please request some assistance with this? Thank you

UPDATE: I found that there are at least two syntactically valid answers to this problem, and while both of them produce the correct Expected Output, one of them got a 0/10 and the other one got a 10/10. I can’t show this without posting an answer. Admins, please let me know where to report this privately and I can show you.

Hi @gralnach! I will reach out via DM, thanks for posting! :slight_smile:

did you found solution ?

Hello, apologies for the late reply. Yes, I found a solution. And the staff was able to correct the test so that all currently known solutions should result in a 10/10 on the autograder

To provide more context for other learners facing this issue. The grader has test cases when there are no spams and no hams so the implementation must take this into account. The latest version of the assignment has a test case that reflects this. In general the implementation should not rely on getting the info out of a tuple or a list (such as the one you get when using value_counts).

1 Like