Professional Documents
Culture Documents
Bays Classifier (Machine Learning)
Bays Classifier (Machine Learning)
Sem : 7 th
Dept : CSE
Topic : Bayesian Classifier
Bayesian Classifier
Bayesian Classifier
• They are statistical classifiers
• Based primarily on the Bayes' Theorem.
• In Bayesian terms, every tuple X is called Evidence
• Let H be some hypothesis such as that X belongs to a specified
classC.
• For classification problems, we want to determine P(HIX), the
proba bility that the hypothesis H holds given X
• Simple put, we are looking for the probability that X belongs
to class Cgiven that we know the attribute description of X, or
we are computing P(CX).
• After computing P(CX) for all classes Cr,i=1..n, we simply
assignX to the class which has the highest value of P(C;|X).
Bayes’ Theorem
P(C/X)=P(X,C)/P(X)
=P(X/C)P(C)/P(X)
• We need to maximize P(C/X), and find the class C;
which maximizes this value. This is the class of X
• Since P(X) is constant across all classes, we can
reduce the problemas follows:
maximize P(CX) = P(X/C)P(C)
• However, computing P(X/C) is incredibly complex for
large datasets involving a large number of attributes
or dimensions.
The Independent Assumption And Naïve Bayes Classifier
Class Conditional Independence
For simplicity, it can be assumed that the effect of an attribute value in X
on a given class C is independent of the values of the other attributes.
With this assumption,
P(X/C)=P(x1/C)P(x2/C)….. P(xn/C)
P(Cyes/X) = P(X/Cyes)P(Cyes)
=P(age = youth/Cyes) P(income =
medium/Cyes)P(student = yes/Cyes)
P(credit =fair/Cyes)P(Cyes)
P(Cno/X) = P(X/Cno)P(Cno)
= P(age = youth/Cno) P(income =
medium/Cno) P(student = yes/
Cno)P(credit = fair/Cno)P(Cno)
Computing the Posterior Probabilities
P(Cyes) = (9/14)
Computing the Posterior Probabilities
P(Cno) = (5/14)
Assigning the Class
Let X = (age = youth, income = medium, student = yes, credit = fair)
P(Cyes/X) = P(X/Cyes) P(Cyes)
= P(age = youth/Cyes) P(income = medium/Cyes)
P(student = yes/Cyes) P(credit = fair/Cyes)P(Cyes)
= 0.028
P(C/X)=P(X,C)/P(X)
• The main issue that arises here is computing P(X. C) which can
easilyswell upto a large number of terms for a moderately sized
dataset.
Bayesian Belief Networks
• Bayesian Belief Networks (BBN) are probabilistic graphical models used to
represent a set of attributes and their dependencies using a Directed Acyclic
Graph (DAG).
Cancer
Laung Tumour
Conditional Independent
•A node in a BBN is said to be
conditionally independent of its non-
descendents given its parents.
P(LT,C,S,ET) = P(LT/C)P(C/ET,S)P(ET)P(S)
= P(LT/C)P(S) Σ
(ET)
P(C/ET, S)P(ET)
The Most Famous Application
• The Microsoft Office Assis-
tant nicknamed "Clippy" was
a prominent feature in MS
Office '97-'03.
• It was implemented partly
using Bayesian Belief
Networks.
Thank You