Skip to content

Instantly share code, notes, and snippets.

@dsilvadeepal
Created August 14, 2018 20:25
Show Gist options
  • Save dsilvadeepal/a05045754ac1f2a561bb08d4512645af to your computer and use it in GitHub Desktop.
Save dsilvadeepal/a05045754ac1f2a561bb08d4512645af to your computer and use it in GitHub Desktop.
Naive Bayes Model
#Create model from the training dataset
sms_classifier <- naiveBayes(sms_train, sms_train_labels)
#Make predictions on test set
sms_test_pred <- predict(sms_classifier, sms_test)
#Create confusion matrix
confusionMatrix(data = sms_test_pred, reference = sms_test_labels,
positive = "spam", dnn = c("Prediction", "Actual"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment