shiridisaibaba22/Email_Spam_Detection_using_Naive_Bayes
Sample Testing examples = [
"Congratulations! You've won a $1000 Walmart gift card. Click here to claim.", # Looks like spam
"Hi John, are we still on for the meeting tomorrow at 10am?", # Looks like ham
"Get cheap loans with zero interest now! Exclusive offer.", # Spam
"Don't forget to bring the documents for our appointment." # Ham
]
7.Email Spam Detection using Naive Bayes Classifier - Build a Naive Bayes classifier to classify emails as spam or not spam based on email text (subject, body content, etc.). Apply text preprocessing (tokenization, stop word removal) and TF-IDF vectorization.
Goal: Build a Naive Bayes classifier to classify emails as spam or not spam based on text (subject/body). We will:
Load a dataset of emails Preprocess text (tokenization, stop word removal) Convert text → numeric features using TF-IDF Train a Naive Bayes classifier Evaluate model performance (accuracy, F1, confusion matrix) Test with new email samples Dataset:
Publicly available SMS Spam Collection dataset (can be used as proxy for email spam detection). Direct CSV link: https://raw.githubusercontent.com/justmarkham/pycon-2016-tutorial/master/data/sms.tsv
