Skip to content

murtazabaig/Spam-SMS-Classification-using-Machine-Learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spam SMS Classification

A clean, end-to-end machine learning project for classifying SMS messages as spam or ham (not spam) using Python. The repository includes a reproducible workflow from data loading and EDA through model training and evaluation.

🧰 Tech Stack

  • Python (pandas, numpy, scikit-learn, matplotlib, seaborn)
  • Jupyter Notebook

📂 Repository Structure

.
├── Spam SMS Classication.ipynb     # Main notebook (EDA → preprocessing → modeling → evaluation)
├── README.md
├── requirements.txt
├── LICENSE
├── .gitignore
└── data/                           # (optional) place raw data here or link in notebook

If your dataset is external, add a short note or a download script in the notebook showing how to fetch it.

🚀 Getting Started

1) Create a virtual environment

python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate

2) Install dependencies

pip install -r requirements.txt

3) Run the notebook

jupyter notebook "Spam SMS Classication.ipynb"

or with JupyterLab:

jupyter lab

🧪 What the Notebook Covers

  • Exploratory Data Analysis (class balance, message length stats, word clouds if applicable)
  • Text cleaning (lowercasing, punctuation/stopword removal, stemming/lemmatization if used)
  • Feature engineering (e.g., TF-IDF or CountVectorizer)
  • Model training (e.g., Logistic Regression, SVM, Naive Bayes)
  • Evaluation (Accuracy, Precision, Recall, F1-score, Confusion Matrix, ROC-AUC)

📊 Example Results

Add a screenshot or table of your best model metrics here, e.g.

Model               Accuracy  Precision  Recall  F1
LogisticRegression  0.98      0.98       0.97    0.98

(Replace with your actual results.)

🔄 Reproducibility

  • Set a fixed random_state where applicable.
  • Note any preprocessing steps and parameters inside the notebook.
  • Keep dataset path configurable (e.g., via a variable like DATA_PATH).

📝 License

This project is released under the MIT License. See LICENSE for details.

🙌 Acknowledgements

  • Dataset: (Add dataset source link if you used one, e.g., UCI SMS Spam Collection)

About

Spam SMS Classification using Machine Learning — End-to-end text classification pipeline to detect spam messages in SMS data. Includes data cleaning, exploratory analysis, feature engineering with TF-IDF, multiple ML models (Logistic Regression, Naive Bayes, etc.), and performance evaluation.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors