Skip to content

AKDGrant/binary-classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Binary Classifier: Spam Detection

This project uses a Naive Bayes classifier to detect spam messages in SMS data.

Dataset

  • Source: SMSSpamCollection
  • 5572 messages with 2 columns: label and message

Approach

  1. Load and clean the data (remove missing values and duplicates)
  2. Map labels (ham → 0, spam → 1)
  3. Vectorize text using CountVectorizer
  4. Train a Multinomial Naive Bayes classifier
  5. Evaluate with accuracy and a confusion matrix

Results

  • Accuracy: ≈ 97.6%
  • Confusion Matrix: Confusion Matrix
  • Test Prediction Example: "Congratulations! You won a free gift card." → Spam (1)

Tools Used

  • Python, Pandas, Scikit-learn, Matplotlib, Seaborn, Jupyter Notebook

About

Spam detection using Naive Bayes classifier in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published