I am not sure why the grade is 0 when all the tests have passed. Can anyone assist on this?
{mentor edit: code attachment removed}
I am not sure why the grade is 0 when all the tests have passed. Can anyone assist on this?
{mentor edit: code attachment removed}
Please do not share your code on the forum. That is not allowed by the Code of Conduct.
I have edited your post to remove the code.
Tips:
I think this thread is labeled incorrectly. Itâs not Multi-Agent Systems with CrewAI, itâs Mathematics for Machine Learning. And the notebook name says âC1_W1â, but the probability and statistics course is C3 in that series.
I checked and in both versions (Coursera and DLAI) of that course, the notebook file has the same name:
C3W1_Assignment.ipynb
Not the name of your file:
C1_W1_Assignment_v2.ipynb.ipynb
I did a quick comparison between your code and mine and youâve made one common mistake: when computing the word frequencies, youâve initialized the ham and spam counts to 0. That might seem intuitively obvious, but they explain in the instructions that we need to do it differently:
** 4.1.1 Handling 0 in the Product*
** Encountering a word that only appears in spam emails or never appears in a spam email may result in đ(wordâŁspam)=0*
** (or the ham analog), leading to the entire product being 0*
** . This scenario is undesirable as a single word could make the entire probability 0*
** . To mitigate this, you will start by counting spam/ham appearances for every word from 1. By artificially assuming that there is at least one spam and one ham email with every word, you eliminate the possibility of 0*
** appearing in the computations.*
(Sorry, thatâs not very legible, but find section 4.1.1 of the instructions and have a look.)