6 Easy Steps to Learn Naive Bayes Algorithm.docx - 6 Easy Steps to Learn Naive Bayes Algorithm(with codes in Python and R SUNIL RAY Note This article

6 Easy Steps to Learn Naive Bayes Algorithm.docx - 6 Easy...

This preview shows page 1 - 3 out of 8 pages.

6 Easy Steps to Learn Naive Bayes Algorithm (with codes in Python and R) SUNIL RAY , SEPTEMBER 11, 2017 Note: This article was originally published on Sep 13th, 2015 and updated on Sept 11th, 2017 Introduction Here’s a situation you’ve got into: You are working on a classification problem and you have generated your set of hypothesis, created features and discussed the importance of variables. Within an hour, stakeholders want to see the first cut of the model. What will you do? You have hunderds of thousands of data points and quite a few variables in your training data set. In such situation, if I were at your place, I would have used Naive Bayes ‘, which can be extremely fast relative to other classification algorithms. It works on Bayes theorem of probability to predict the class of unknown data set. In this article, I’ll explain the basics of this algorithm, so that next time when you come across large data sets, you can bring this algorithm to action. In addition, if you are a newbie in Python or R , you should be overwhelmed by the presence of available codes in this article. Table of Contents 1. What is Naive Bayes algorithm? 2. How Naive Bayes Algorithms works? 3. What are the Pros and Cons of using Naive Bayes? 4. 4 Applications of Naive Bayes Algorithm 5. Steps to build a basic Naive Bayes Model in Python 6. Tips to improve the power of Naive Bayes Model What is Naive Bayes algorithm? It is a classification technique based on Bayes’ Theorem with an assumption of independence among predictors. In simple terms, a Naive Bayes classifier assumes that the presence of a particular feature in a class is unrelated to the presence of any other feature.
Image of page 1

Subscribe to view the full document.

For example, a fruit may be considered to be an apple if it is red, round, and about 3 inches in diameter. Even if these features depend on each other or upon the existence of the other features, all of these properties independently contribute to the probability that this fruit is an apple and that is why it is known as ‘Naive’. Naive Bayes model is easy to build and particularly useful for very large data sets. Along with simplicity, Naive Bayes is known to outperform even highly sophisticated classification methods. Bayes theorem provides a way of calculating posterior probability P(c|x) from P(c), P(x) and P(x|c). Look at the equation below: Above, P ( c|x ) is the posterior probability of class (c, target ) given predictor (x, attributes ).
Image of page 2
Image of page 3
  • Fall '17

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes