0% found this document useful (0 votes)
20 views

Ass 3

This document provides instructions for writing a Python program to implement spam mail detection using machine learning. It introduces email spam and the need for improving spam filtering algorithms. It recommends using the Naive Bayes algorithm with scikit-learn to classify emails as spam or not spam. It explains how to split data into training and test sets using train_test_split() to evaluate the model's performance at identifying spam emails. The goal is to demonstrate how Python can be used for machine learning tasks like spam filtering.

Uploaded by

cecohav455
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Ass 3

This document provides instructions for writing a Python program to implement spam mail detection using machine learning. It introduces email spam and the need for improving spam filtering algorithms. It recommends using the Naive Bayes algorithm with scikit-learn to classify emails as spam or not spam. It explains how to split data into training and test sets using train_test_split() to evaluate the model's performance at identifying spam emails. The goal is to demonstrate how Python can be used for machine learning tasks like spam filtering.

Uploaded by

cecohav455
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

3. Write a program in python script for Spam Mail Detection (Spam Filtering Implementation.

Write-up Correctness Documentation Viva Timely Total Dated sign


of program of program Completion of SubjectTeacher

2 2 2 2 2 10
Introduction

Email spam, also called junk email, is unsolicited messages sent in bulk by email
(spamming).
Anyone having an e-mail address must have faced unwanted e-mails which we call spam mail.
Modern spam filtering software are continuously struggling to detect unwanted e-mails and mark
them as spam mail. It is an ongoing battle between spam filtering software and anonymous spam
mail senders to defeat each other. Because of that, it is very important to improve spam filters
algorithm time to time. Behind the scenes, we use Machine-learning algorithm to find unwanted
e-mails. More specifically, we use text classifier algorithm like Naïve Bayes, Support Vector
Machine or Neural Network to do the job. In this article, I will try to show you how to use Naïve
Bayes algorithm to identify spam e-mail. I will also try to compare the results based on statistics.
We will use Python to do the job. I will try to show you power of python in Machine Learning
world.

Python Packae : Scikit-learn, also called Sklearn, is a robust library for machine learning in
Python. It provides a selection of efficient tools for machine learning and statistical modeling,
including classification, regression, clustering, and dimensionality reduction via a consistent
interface.

Python train_test_split()
We’ll use a train-test split method to train our email spam detector to recognize and categorize
spam emails. The train-test split is a technique for evaluating the performance of a machine
learning algorithm. We can use it for either classification or regression of any supervised learning
algorithm.
The procedure involves taking a dataset and dividing it into two separate datasets. The first
dataset is used to fit the model and is referred to as the training dataset. For the second dataset,
the test dataset, we provide the input element to the model. Finally, we make predictions,
comparing them against the actual output.
• Train dataset: used to fit the machine learning model
• Test dataset: used to evaluate the fit of the machine learning model
To split the data into our two datasets, we’ll use scikit-learn’s train_test_split() method.

Conclusion
Here we conclude that, you are done creating your email spam detection program.

You might also like