- The following training dataset is “reading email datasetâ€.
This dataset has four features asfollows: author, thread, length, and where to read the mail.According to the features the algorithm has to predict the user’saction whether to read or skip the mail.
Use Naïve Bayes classifier to predictthe user’s action (skips or reads) when the author of the mail isknown, the thread of the mail is follow up, the length of the mailis short, and where to read the email is home.
Author | Thread | Length | Where to read | User’s Action |
Known | new | long | home | Skips |
unknown | new | short | work | Reads |
unknown | Follow up | long | work | Skips |
Known | Follow up | Long | Home | Skips |
Known | New | Short | Home | Reads |
Known | Follow up | Long | Work | Skips |
Unknown | New | short | work | skips |
Unknown | New | short | Work | reads |
Known | Follow up | Long | Home | Skips |
known | New | Long | Work | skips |
unknown | Follow up | short | home | Skips |
Known | new | Long | work | Skips |
Known | Follow up | Short | Home | Reads |
Known | New | Short | Work | Reads |
known | New | short | Home | Reads |
Known | Follow up | short | Work | Reads |
Known | New | Short | home | Reads |
unknown | new | short | work | Reads |
- Write a Python code to implement a naïve Bayesian classifier topredict the user’s action (skips or reads) when the author of themail is known, the thread of the mail is follow up, the length ofthe mail is short, and where to read the email is home. (Do not useScikit-Learn)
- Use Scikit-Learn to predict the user’s action (skips or reads)when the author of the mail is known, the thread of the mail isfollow up, the length of the mail is short, and where to read theemail is home.
Hint in authors feature you can use 0,1 instead of unknown and known. In thread feature you can use 0, 1instead of follow up and new. In length feature you can use 0, 1instead of short and long. In where to read feature you can use 0,1 instead of home, work. In the target you can use 0 instead ofskips and 1 instead of reads.