Skip to content

atiurXdev/spam-mail-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“§ Spam Mail Detection using Machine Learning

This project builds a Spam Mail Detection model using Natural Language Processing (NLP) and Machine Learning techniques.

The model classifies messages as:

  • Spam (0)
  • Ham (1)

It uses TF-IDF Vectorization and Logistic Regression for classification.


πŸš€ Technologies Used

  • Python
  • NumPy
  • Pandas
  • Scikit-learn
  • Matplotlib
  • Seaborn

🧠 Machine Learning Workflow

  1. Load dataset
  2. Data cleaning & handling null values
  3. Label encoding (Spam = 0, Ham = 1)
  4. Train-test split (80-20)
  5. Text feature extraction using TF-IDF
  6. Model training using Logistic Regression
  7. Model evaluation (Accuracy, Confusion Matrix)
  8. Custom message prediction

πŸ“Š Model Performance

  • Training Accuracy: ~97%
  • Testing Accuracy: ~96%

(Accuracy may slightly vary depending on random_state.)


πŸ§ͺ Example Prediction

Input: "Congratulations! You have won a $1000 gift card. Click the link now!"

Output: Spam


πŸ“‚ Project Structure

spam-mail-detection/ β”‚ β”œβ”€β”€ spam_mail_detection.ipynb β”œβ”€β”€ mail_data.csv └── README.md


🎯 Key Learnings

  • Text preprocessing
  • TF-IDF feature extraction
  • Logistic Regression implementation
  • Model evaluation techniques
  • Real-world text classification workflow

πŸ‘¨β€πŸ’» Author

Atiur Rahaman
AIML Student | Machine Learning Enthusiast

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors