Question
Train the Naive Bayes Classifiers in Python. The classier uses only bag-of-word features. Assume the following parameters for each word being part of a positive
Train the Naive Bayes Classifiers in Python.
The classier uses only bag-of-word features. Assume the following parameters for each word being part of a positive or negative movie review, and the prior probabilities are 0.4 for the positive class and 0.6 for the negative class.
1) What class will Nave Bayes assign to the sentence I always like foreign lms? Show your work In Python Programming
2) Implement in Python a Nave Bayes classier with bag-of-word features and add-1 smoothing.
Note: Smoothing should be used for the context features (bag-of-word features) only. Do not use smoothing for the prior parameters.
posneg 0.090.16 always 0.07 0.06 0.290.06 foreign 0.04 0.15 films0.080.11 like posneg 0.090.16 always 0.07 0.06 0.290.06 foreign 0.04 0.15 films0.080.11 likeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started