In this article we will discuss Bayes theorem and how this is used for spam classification in the machine…