in Education by
Can someone explain the process of Naive Bayes in simple english? How is the training data related to the actual dataset? Explain with an example. Select the correct answer from above options

1 Answer

0 votes
by
To understand Naive Bayes classification we first need to understand Bayes Theorem. Bayes Theorem works on the conditional probability.Conditional probability it is the probability of occurrence of something,given that something else has already occurred. Naive Bayes is a kind of classifier which implements Bayes Theorem. Naive Bayes predicts membership probabilities for each class such as the probability of a given record or data point that belongs to a particular class. The class which has the highest probability is considered the most likely class. This is also known as Maximum A Posteriori (MAP). Naive Bayes classifier assumes that all the features are unrelated to each other, so the absence or presence of a feature does not influence the presence or absence of another feature. Formula- P(H|E)=(P(E|H) * P(H))/P(E) Where , P(H) is the prior probability. P(E) is the probability of the evidence(regardless of the hypothesis). P(E|H) is the probability of the evidence given the hypothesis is true. P(H|E) is the probability of the hypothesis given that the evidence is there. Example- Let us assume we have data of 1000 fruits from which some are banana, orange, and some other fruit, each fruit has classified using three characteristics: round Sweet red Training set: Type Round | Not Round || Sweet | Not Sweet || Red|Not Red|Total ______________________________________________________ Apple | 400 | 100 || 250 | 150 || 450 | 50 | 500 Banana | 0 | 300 || 150 | 150 || 300 | 0 | 200 other fruit | 100 | 100 || 150 | 50 || 150 | 50 | 300 ______________________________________________________ Total | 500 | 500 || 550 | 350 || 900 | 100 | 1000 Step 1: finding the ‘prior’ probabilities for each class of fruits. P(Apple) = 500 / 1000 = 0.50 P(Banana) = 200 / 1000 = 0.20 P(other fruit) = 300 / 1000 = 0.30 Step 2: finding the probability of evidence p(round) = 0.5 P(Sweet) = 0.65 P(red) = 0.8 Step 3: finding the probability of likelihood of evidences : P(round|Apple) = 0.8 P(round|Banana) = 0 P(Red|Other Fruit) = 150/300 = 0.75 P(Not red|Other Fruit) = 50/300 =0.25 Step 4: Putting the values in equation: P(Apple|Round, Sweet, and Red) = P(Round|Apple) * P(Sweet|Apple) * P(Red|Apple) * P(Apple)/P(Round) * P(Sweet) * P(Red) = 0.8 * 0.5 * 0.9 * 0.5 / P(evidence) = 0.18 / P(evidence) P(Banana|Round, Sweet and Red) = 0 P(Other Fruit|Round, Sweet and Red) = ( P(Round|Other fruit) * P(Sweet|Other fruit) * P(Red|Other fruit) * P(Other Fruit) ) /P(evidence) = (100/300 * 150/300 * 150/300 * 300/1000) / P(evidence) =( 0.33*0.5 * 0.5 * 0.3) / P(evidence) =(0.02475)/P(evidence) Through this example we classify that this round,sweet and red colour fruit is likely to be an Apple. Since Bayes' theorem forms a part of Machine Learning Tutorial, learning it will somewhat help in mastering Machine Learning Course by Intellipaat.

Related questions

0 votes
    While implementing Naive Bayes classifier, I have noticed that using some feature selection, I got 30% text ... better accuracy? Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    I am a beginner and want to know what exactly the difference between these two algorithms. Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    Support Vector Machines, Naive Bayes and Logistic Regression are used for solving ___________________ problems. (a) Clustering (b) Classification (c) Regression (d) Time Series...
asked Oct 19, 2020 in Technology by Editorial Staff
0 votes
    Expectation Maximization (EM) may be a quite probabilistic methodology to classify data. Tell me if i'm wrong ... maximized here? Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    I'm wondering how to calculate precision and recall measures for multiclass multilabel classification, i.e. classification ... labels? Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    Everybody. I am entirely new to the topic of classification algorithms, and need a few good pointers about where to ... Hints, anyone? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Can someone explain the basic difference between classification and clustering? Provide some examples. Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    I'm teaching a kid programming, and am introducing some basic artificial intelligence concepts at the moment. To begin ... and boxes)? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I am a little confused about the Hill Climbing algorithm. I want to "run" the algorithm until I found the ... question is too simple. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I was trying to solve this hiring contest problem (now closed) Lexicographic Rows You are given a matrix of characters. In one ... { //Current is valid if (input[i - 1][j]...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    just wondering what it is. Edit: I know it's not a type of array but just a feature. So what ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    just wondering what it is. Edit: I know it's not a type of array but just a feature. So what ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    I'm trying to put several images together into one big image, and am looking for an algorithm which ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    I'm trying to put several images together into one big image, and am looking for an algorithm which ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    As it currently stands, this question is not a good fit for our Q&A format. We expect answers to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
...