Skip to content

Latest commit

Β 

History

History
74 lines (41 loc) Β· 1.64 KB

File metadata and controls

74 lines (41 loc) Β· 1.64 KB

πŸ“§ SVM Email Spam Classifier

A machine learning project that classifies emails as Spam or Ham (Not Spam) using TF-IDF Vectorization and Support Vector Machine (SVM). The project includes a Streamlit web app, and the trained model is saved using joblib.

πŸš€ Features

Converts email text into numerical features using TF-IDF

Uses SVM with RBF kernel for classification

Clean and fast email prediction

Simple Streamlit UI for user input

Model & vectorizer saved and loaded using joblib

πŸ“‚ Project Structure spam-classifier/ │── svm_model.joblib #Saved SVM model │── vectorizer.joblib #Saved TF-ID vectorizer │── app.py #app for prediction │── README.md # Project documentation |__requirements.txt

🌐 Running the App

Run the Streamlit web app:

streamlit run app.py

A webpage will open where you can paste any email text, and the model will classify it as:

βœ” HAM β€” The email is safe 🚨 SPAM β€” Suspicious email detected

πŸ›  Installation

Install the required packages:

pip install streamlit scikit-learn joblib pandas

🧠 How It Works

User enters an email

The saved TF-IDF vectorizer converts text β†’ numerical features

The saved SVM model predicts spam or ham

Streamlit displays the result instantly

πŸ“¦ Deployment

You can deploy this project to:

Streamlit Cloud

HuggingFace Spaces

Render

Any cloud platform supporting Python

⭐ Future Improvements

Add probability/probability heatmap

Add email preprocessing (cleaning)

Try Naive Bayes / Logistic Regression models

Visualize word importance