Skip to content

RheedWhan/Email-Spam-Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Email Spam Classification

Overview

This repository contains code for a machine learning model that classifies emails as spam or non-spam (ham). The model uses a Support Vector Machine (SVM) algorithm with a text classification approach.

Table of Contents

Background

This project aims to build a machine learning model for classifying emails as spam or non-spam. The SVM algorithm is chosen for its effectiveness in text classification tasks.

Features

  • Text classification using Support Vector Machine (SVM)
  • Model training, evaluation, and tuning scripts

Requirements

  • Python 3.6+

Usage

  • To use the Email Spam Classification code, follow these steps:
  1. Prepare Your Data:

    Ensure your email data is in a suitable format for the model. For example, a CSV file with columns for email text and labels.

  2. Train the Model:

    Use the train_model.py script to train the SVM model on your training data.

  3. Make Predictions:

    After training, you can use the model to make predictions on new email data.

Data

  • The dataset used for this project can be found at Dataset Source.

Model Training

  • To train the SVM model on your data, use the train data. Ensure your data is properly formatted and split into training and testing sets.

Evaluation

  • Evaluate the model's performance using the evaluation metric. This will provide insights into accuracy and other relevant metrics.

Tuning

  • Experiment with hyperparameter tuning to improve model performance. Adjust parameters in the tuned_param dictionary within the train_model.py script.

    tuned_param = {'kernel': ['linear', 'rbf'], 'gamma': [1e-3, 1e-4], 'C': [1, 10, 100, 1000, 10000]}

Results

  • The accuracy is 86%. We couldn't achieve higher accuracy because the dataset is little

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors