# Machine Learning with Naïve Bayes

Introducing you to the topics of Bayesian statistics and Naïve Bayes algorithms in Python’s scikit-learn library.

with Hristina Hristova

Start course#### Course Overview

Knowledge on various machine learning algorithms is essential for machine learning enthusiasts and specialists. This course focuses on a specific type of classifier – the Naïve Bayes one. It is famous for being a quick learner and a real-time problem solver. Not only will you learn the theoretical foundations behind the Bayesian approach, but you will also get the chance to solve a real-life problem using scikit-learn’s Naïve Bayes algorithms.

#### Skills you will gain

#### What You'll Learn

Aiming to expand your machine learning toolbox? Here is how this course will help you!

#### Curriculum

- Bayes' Theorem Free5 Lessons 25 Min
This section serves as a theoretical introduction to the Bayesian approach which will later help us understand the Naïve Bayes machine learning classification algorithm. We start with an intuitive example which Thomas Bayes himself introduced. Then, we dive into the mathematics behind his approach and derive Bayes’ theorem. Finally, we apply this theorem to classify an e-mail message as a spam or not-spam (also known as a ham).

What does the course cover? Free Motivation Free Bayes' thought experiment Free Bayes' theorem Free The ham-or-spam example Free - Setting up the Environment Free2 Lessons 4 Min
In this section you will learn how to install all Python packages relevant for the next part of the course focused on practice.

Setting up the environment Free Installing the relevant packages Free - Naïve Bayes Algorithm - Practical Example7 Lessons 40 Min
This is the practical section of the course where we roll our sleeves up and build our very own classification model. We use a dataset containing YouTube comments – some well-intended and others harmful. Our task is to train a model that could later serve as a spam comment detector. To do this, we make use of Python’s scikit-learn library, where a Naïve Bayes algorithm is implemented. Throughout this section, we will study the inner workings of the algorithm and learn how to interpret performance metrics such as accuracy, precision, recall, and F1 score.

The YouTube Dataset: Creating the data frame CountVectorizer The YouTube Dataset: Preprocessing The YouTube Dataset: Classification The YouTube Dataset: Confusion matrix The YouTube Dataset: Accuracy, Precision, Recall, and the F1 score The YouTube Dataset: Changing the priors

#### “Learning various machine learning techniques expands your horizons in the field and teaches you how to think outside of the box. It makes you a skilled programmer and a better problem-solver. This course introduces you to a rather simple, yet quite powerful algorithm. Sophisticated algorithms would always serve you well, but sometimes simpler is better!”

##### Hristina Hristova

##### Content Creator at 365 Data Science

##### Machine Learning with Naïve Bayes

with Hristina Hristova