0% found this document useful (0 votes)
770 views

Assignment 3.solution

This document provides a Naive Bayes classifier example to predict whether a car was stolen based on its color, type, origin, and whether it was stolen in previous cases. The classifier calculates the probabilities of a red, domestic, SUV car being stolen or not stolen based on the training data. It determines that a red, domestic, SUV car is more likely to not be stolen, since the probability of 0.072 for not stolen is greater than the 0.024 probability for stolen.

Uploaded by

Mohammad Sharif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
770 views

Assignment 3.solution

This document provides a Naive Bayes classifier example to predict whether a car was stolen based on its color, type, origin, and whether it was stolen in previous cases. The classifier calculates the probabilities of a red, domestic, SUV car being stolen or not stolen based on the training data. It determines that a red, domestic, SUV car is more likely to not be stolen, since the probability of 0.072 for not stolen is greater than the 0.024 probability for stolen.

Uploaded by

Mohammad Sharif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Muhammad Sharif

MSEE02173023

Assignment 3: Naïve Bayesian Classifier


Consider a data set (take a reasonable number of observations) from the
literature or research papers or some other source to train a Naïve Bayes
model. Then make a prediction to a new record. Take at least three different
separate new records for making prediction. Use well the formula to estimate
prior and conditional probability (likelihoods).

Question: For the given data set apply naïve-baye’s algorithm, we will predict
the outcome for car.
Color Type origin Stolen
Red Sports Domestic yes
Red Sports Domestic No
Red Sports Domestic Yes
Yellow Sports Domestic No
Yellow Sports Imported Yes
Yellow SUV Imported No
Yellow SUV Imported Yes
Yellow SUV Domestic No
Red SUV Imported No
Red Sports Imported Yes

P(A|B) = P(B|A). P(A)/ P(B)


P(A|B) = Posterior
P(B|A) = Likelihood
P(A|B) = probability of (A) when B is true.
P(B|A) = probability of (B) when A is true.
P(A)= Probability of occurrence A
P(B)= Probability of Occurrence B
What is sample space is here
X=[ Red, Domestic, SUV ]

Let say we think that Red car is stole, so what stolen probability.

(i) P (Red|Yes)= P(Yes|Red). P(Red)/P(Yes)= (3/5.5/10)/(5/10)=3/5


(ii) P(Domestic|Yes) = 2/5
(iii) P(Yes|SUV)= 1/5

We already suppose that car is stolen.


X=[ Red, Domestic, SUV ]
P(X|Yes) =3/2.5/2.1/5=6/125=0.024
Let say car is not stolen, then what will be probility,
P(Red|No) = P(No|Red). P(Red)/P(No)=(2/5.5/10)/5/10=2/5
P(Domestic|No) =3/5
P(SUV|No) =2/5
P(X|No)=2/5.3/5.2/5=0.072

Which Number is greater than 0.072 greater than 0.024 So probability of car
stolen is no.

You might also like