Skip to content

An implementation of the naive bayes classifier algorithm for a spam filtering application.

Notifications You must be signed in to change notification settings

Ajmain-Khan/Naive-Bayes-Spam-Filtering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Naive-Bayes-Spam-Filtering

A Java implementation of the naive bayes classifier algorithm in an application to detect and filter spam and stop words.

Interface Features

  • A visual representation of the accuracy and precision
  • Shows distribution of ham(H) files and spam(S) files in training and testing phase

Demo

Preview

Model features

Naive Bayes spam filtering

First computation:

Equation

Second Computation:

Equation

Equation

Third Computation (Improved detection):

Equation

Where , Equation and Equation number of files that have Equation

The third computation deals with rare words by putting more confidence in the spam probability than the default probability, if the word occurs more than 4 times in the training phase

Stop words (Improved detection):

Does not evaluate stop words specified in stopwords.txt.

Stop words like "a", "the", or "is" provide little to no context to if the file is a spam. Therefore, it is optimal to not evaluate such words

Build Instructions for IntelliJ

Prerequisites: JDK 15+, JAVAFX 15+

1. Clone the repository

 git clone https://github.com/Ajmain-Khan/Naive-Bayes-Spam-Filtering

2. In Intellij, navigate to (File -> Project Structure)

i. Navigate to Project and add the Java 15 SDK

ii. Navigate to Global Libraries and add JavaFX 15 to modules

3. Edit run configurations

i. Add an application template, modify it to direct to src.main

ii. Add VM options --module-path "path-to-lib" --add-modules javafx.controls,javafx.fxml

About

An implementation of the naive bayes classifier algorithm for a spam filtering application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages