A naive Bayes classifier learns which words predict a target label, using Bayes' theorem and a conditional-independence assumption among features. For sentiment analysis, it replaces hand-written word scores with scores learned from labeled documents. section 2.6.2
A practical text-classification workflow is:
- Load labeled movie reviews and convert their continuous sentiment ratings into positive or negative labels. section 2.6.2
Movie-review sentiment
The fitted classifier reaches 93.4% agreement with the movie-review labels shown, but applying it to product reviews falls to about 55.7%, illustrating the importance of matching training data to the target domain.




