Created
July 15, 2020 08:53
-
-
Save yogeshnile/ad8eecfd4b647e277bd532abccee8e2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#train_test_split | |
from sklearn.model_selection import train_test_split | |
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, random_state=0) | |
#Fitting Naive Bayes to the Training set | |
classifier = MultinomialNB(alpha=0.1) | |
classifier.fit(X_train, y_train) | |
#Save Model | |
file_name = "Spam_sms_prediction.pkl" | |
pickle.dump(classifier, open(file_name, 'wb')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment