Skip to content

alvarobello33/SMS-Spam-Filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“§ SMS Spam Filter using Naive Bayes (MATLAB) πŸ”

University Project
Alvaro Bello ✨
Development Date: 14/05/2023 πŸ“…

Description 🧠

This project implements a simple spam filter for SMS messages using the Naive Bayes classifier in MATLAB. It classifies messages as either ham (non-spam) or spam based on their word content.

The classifier is trained using the well-known SMSSpamCollection dataset, and uses a Bag of Words model to estimate word frequencies in spam and ham messages, in order to predict if the message is ham or spam.

Project Structure πŸ“

SMS-Spam-Filter/
β”œβ”€β”€ data/                       # Folder storing datasets
β”‚ └── smsspamcollection/
β”‚ β”‚ └── SMSSpamCollection       # Raw dataset file
β”‚ 
β”œβ”€β”€ extra_functions/            # Provided helper functions (from La Salle University)
β”œβ”€β”€ main.m                      # Main MATLAB script
β”‚ 
β”œβ”€β”€ Project_Documentation.pdf   # Detailed documentation of the project
└── README.md

Results πŸ“ˆ

The script was executed 10 times in total:

  • 5 runs with the crossDeleteWords function enabled.
  • 5 runs without it.

The experiments yielded an average classification accuracy of 95%, demonstrating not only the effectiveness of the Naive Bayes approach on the SMSSpamCollection dataset, but also that even a simple implementation can achieve highly reliable results in spam detection tasks.

How to Run ▢️

  1. Make sure you have MATLAB installed.
  2. Download or clone this repository.
  3. Run the main script:
>> main.m

Development Environment πŸ› οΈ

  • Programming Language: Matlab
  • IDE: Matlab IDE

Credits πŸ§‘β€πŸ«

  • Dataset: SMSSpamCollection
  • Helper functions provided by La Salle University.
  • Developed as part of a practical assignment on spam detection and text classification.

About

Simple spam filter for SMS messages using the Naive Bayes classifier in MATLAB.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages