Naive Bayes algorithm for document classification
Keywords:
document classification, Bayesian classification, Naïve Bayes’ method, Python, posterior probabilityAbstract
Classification or document categorization is a problem in library science, information science and computer science. This paper presents an automatic document classification system based on their content using the prior choice in classifying similar document. The classification algorithm is based on the Bayes’ theorem from probability theory. In this paper the focus is on the Naive Bayes’ method of predicting posterior choice based on the prior or previous classification of similar document. The documents used for this study are digital document in the form of emails. A sample of 5000 random emails were collected from different sources on the internet, these emails are saved as text documents separated in two categories; spam and ham to represent two distinct features. An algorithm is developed into a python code that automatically classify a new email in the form of text document into either category: spam or ham. Any of the two features represents a category in which a document can be grouped. The result output of this research is an algorithm which has 82.88% efficiency. This is better than the average efficiency percentage of other spam filters which use other methods. It was observed from the performance of the algorithm that the use of the Naive Bayes classification method performed better than the average spam filter algorithm.
Downloads
Downloads
Published
Issue
Section
License
Copyright (c) 2022 Annals of Mathematics and Computer Science

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.