C1_W2_Assignment - 3 unit case failing

Hi,

Attempting the C1_W2_Assignment.

Example tweet expected output matches. Unit test success for 9 out of 12.

3 are failing with message “Wrong values for loglikelihood dictionary. Please check your implementation for the loglikelihood dictionary.”, but that is a simple implementation using log of a fraction. I have imported log from the math package.

I looked at the posted discussion earlier, but I am getting the count from the freqs dictionary

hi @anindya5

can you confirm you didn’t edit or add anything outstanding the assigned markers ###START AND END CODE HERE###?

You Also mentioned you imported log from math package? As far as I remember all required modules or libraries to be used in the assignments are already provided and you aren’t suppose to individually import any libraries by you in any of the grade function, probably that could be one of reason you are failing the unittest.

Also Try to post screenshot of any error you encountered or the grader output information you got, or in case if your expected output don’t match with your output. Please make sure while posting screenshot not to post any part of the grade functions codes which grades your assignment as it is against community guidelines.

Regards
DP

from utils import process_tweet, lookup
import pdb
from nltk.corpus import stopwords, twitter_samples
import numpy as np
import pandas as pd
import nltk
import string
from nltk.tokenize import TweetTokenizer
from os import getcwd
import w2_unittest


nltk.download('twitter_samples')
nltk.download('stopwords')

This was the default, it has no logarithm added. Without importing log from maths code was raising error

It was a different mistake, but that log thing is really missing. Importing from maths, passed unit test

please click on my name and then message me screenshots of grade function codes

You have imported numpy as np, so just use np.log. It works with scalars as well as numpy arrays. There is no need for additional imports.