Machine Learning for OpenCV 4 by Aditya Sharma

Machine Learning for OpenCV 4 by Aditya Sharma

Author:Aditya Sharma [Aditya Sharma]
Language: eng
Format: epub
Tags: COM012050 - COMPUTERS / Image Processing, COM051360 - COMPUTERS / Programming Languages / Python, COM004000 - COMPUTERS / Intelligence (AI) and Semantics
Publisher: Packt
Published: 2019-09-06T14:46:28+00:00


Implementing a Spam Filter with Bayesian Learning

Before we get to grips with advanced topics, such as cluster analysis, deep learning, and ensemble models, let's turn our attention to a much simpler model that we have overlooked so far: the Naive Bayes classifier.

Naive Bayes classifiers have their roots in Bayesian inference, named after the famed statistician and philosopher Thomas Bayes (1701-1761). Bayes' theorem famously describes the probability of an event based on prior knowledge of conditions that might lead to the event. We can use Bayes' theorem to build a statistical model that not only can classify data but can also provide us with an estimate of how likely it is that our classification is correct. In our case, we can use Bayesian inference to dismiss an email as spam with high confidence and to determine the probability of a woman having breast cancer, given a positive screening test.

We have now gained enough experience with the mechanics of implementing machine learning methods, and so we should no longer be afraid to try and understand the theory behind them. Don't worry, we won't write a book on it, but we need some understanding of the theory to appreciate a model's inner workings. After that, I am sure you will find that Bayesian classifiers are easy to implement, are computationally efficient, and tend to perform quite well on relatively small datasets. In this chapter, we will understand the Naive Bayes classifier and then implement our first Bayesian classifier. We will then classify emails using the Naive Bayes classifier.

In this chapter, we will cover the following topics:

Understanding the Naive Bayes classifier

Implementing your first Bayesian classifier

Classifying emails using the Naive Bayes classifier



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.