Python, Programming, Data Science, Artificial Intelligence, Machine Learning.
classifier classifier = MultinomialNB() classifier.fit(X, labels) # Test the classifier on new email messages new_emails = [ "You have been selected for a free gift!", "Please review the attached document", "Lose weight fast with this secret formula!" ] X_new = vectorizer.transform(new_emails)