Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

6. Document Filtering > Exercises

Exercises

  1. Varying assumed probabilities. Change the classifier class so it supports different assumed probabilities for different features. Change the init method so that it will take another classifier and start with a better guess than 0.5 for the assumed probabilities.

  2. Calculate Pr(Document). In the naïve Bayesian classifier, the calculation of Pr(Document) was skipped since it wasn’t required to compare the probabilities. In cases where the features are independent, it can actually be used to calculate the overall probability. How would you calculate Pr(Document)?

  3. A POP-3 email filter. Python comes with a library called poplib for downloading email messages. Write a script that downloads email messages from a server and attempts to classify them. What are the different properties of an email message, and how might you build a feature-extraction function to take advantage of these?


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint