GithubHelp home page GithubHelp logo

email-spam-classification's Introduction

Email/ SMS Spam Classification

Kaggle Dataset - https://www.kaggle.com/datasets/uciml/sms-spam-collection-dataset

The SMS Spam Collection is a set of SMS-tagged messages that have been collected for SMS Spam research. It contains one set of SMS messages in English of 5,574 messages, tagged according to being ham (legitimate) or spam.

The following tasks were performed in the sms-spam-detection.ipynb file

1. Data cleaning

  • Dropped the column null values
  • Dropped for duplicate rows
  • Encoded the target variable

2. Exploratory Data Analysis

  • Visualized Spam and Not Spam dataset and found the data was imbalanced
  • NLTK Punkt sentence tokenizer is used to calculate the number of characters, number of words, and number of sentences in the text feature.
  • After adding the above three features, the dataset is visualized. The correlation Matrix shows a high correlation between the three new features. Therefore, only one feature among them is used for further pre-processing tasks.
  • Spam and Not Spam words are visualized using word cloud

3. Text Preprocessing

The following pre-processing tasks were implemented:-

  • Lower case
  • Tokenization
  • Removing special characters
  • Removing stop words and punctuation
  • Stemming

4. Model building

  • CountVectorizer and TfidfVectorizer are used to convert text to vector values
  • Naive Bayes (GaussianNB,MultinomialNB,BernoulliNB)
  • LogisticRegression
  • Support Vector Classifier
  • KNeighbors Classifier
  • Decision Tree Classifier
  • Random Forest Classifier
  • AdaBoost Classifier
  • Bagging Classifier
  • Extra Trees Classifier
  • Gradient Boosting Classifier
  • XGBoost Classifier
  • Voting Classifier
  • Stacking

5. Website

  • Designed a webpage using Streamlit to deploy the model

email-spam-classification's People

Contributors

venkydesai avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.