Project - Building Spam Classifier

4 / 27

Spam Classifier - Call the Function

You can call a function simply using it's name follwed by two backets '(' and ')' . If the function name is calculate you can call using calculate()

INSTRUCTIONS

Now we will call the function we created in the previous step.

<< your function name >>()
Get Hint See Answer


Note - Having trouble with the assessment engine? Follow the steps listed here

Please login to comment

8 Comments

After executing fetch_spam_data(), the following error is coming up:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-7-404f1c0a1f49> in <module>()
----> 1 fetch_spam_data(spam_url=SPAM_URL, spam_path=SPAM_PATH)

<ipython-input-3-b82aa973eb42> in fetch_spam_data(spam_url, spam_path)
     14         path = os.path.join(spam_path, filename)
     15         if not os.path.isfile(path):
---> 16             urllib.request.urlretrieve(url, path)
     17         tar_bz2_file = tarfile.open(path)
     18         tar_bz2_file.extractall(path=SPAM_PATH)

AttributeError: module 'urllib' has no attribute 'request'
  Upvote    Share

Hi,

Please makesure to import the library `urllib` and execute all the previous steps sequentially before this.

Thanks.

  Upvote    Share

Hi,

i'm also gettirng the same error even though i have imported the urllib properly

  Upvote    Share

Hi,

Makesure to execute that cell where you imported it  before uing the library.

Thanks.

  Upvote    Share

calling the function without any argument is giving error,

  Upvote    Share

nevermind figured it out , typo in code.

  Upvote    Share

Calling the  function fetch_spam_data() taking lot of time

  Upvote    Share

Hi,

This is normal since it is downloading the dataset over the internet.

Thanks.

  Upvote    Share