In this article, we are going to be examining the distinction between using a Logistic Regression and Naive Bayes for text classification of coffee drink reviews as positive or negative.
Dataset used is a corpus of a coffee drinks reviews, the consumers reviews about how the drink tastes. A quick one on the reminder into Logistic Regression and Naive Bayes. They are both machine learning techniques for binary classification, which was used to determine whether the review is going to be positive or negative.
Step 1: Prepare the data
Step 2: Data Processing
Step 3: Split the data set into test and training set
Step 4:Numerically encode the input data set
Step 5: Fit the model
Step 6: Evaluate the model
Error Metric with Logistic Regression
F1 Score: 0.908
Confusion Matrix with Logistic Regression
Error Metric with Naive Bayes
F1 Score: 0.91
Confusion Matrix with Naive Bayes
We can see that obtain a better metric with Naive Bayes Classification
To get the source code and the data set, please go through my GitHub repository