Skip to content

A simple machine learning project that classifies emails as Spam or Ham using Logistic Regression and TF-IDF vectorization. Built with Python and scikit-learn.

Notifications You must be signed in to change notification settings

Moez-lab/Spam-Email-Detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“§ Email Spam Detection

A simple machine learning project that classifies emails as Spam or Ham using Logistic Regression and TF-IDF vectorization. Built with Python and scikit-learn.


πŸš€ Features

  • Preprocesses and cleans email text data
  • Converts text to numerical features using TF-IDF
  • Trains a Logistic Regression model
  • Predicts if a given message is spam or not
  • Simple and beginner-friendly code

πŸ› οΈ Tech Stack

  • Python
  • Pandas
  • Scikit-learn
  • TfidfVectorizer
  • LogisticRegression

πŸ“‚ Dataset

The dataset mail_data.csv contains:

  • Category: Label (spam or ham)
  • Message: Email/message text

πŸ“Œ Example Usage

input = ["πŸŽ‰ You've won $500! Click now to claim your prize."]
input_data_features = feature_extraction.transform(input)
prediction_on_input = model.predict(input_data_features)

if prediction_on_input[0] == 0:
    print('Spam')
else:
    print('Ham')

πŸ“ˆ Output

Spam


About

A simple machine learning project that classifies emails as Spam or Ham using Logistic Regression and TF-IDF vectorization. Built with Python and scikit-learn.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages