














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















X,X, … X^12
|Y=vm
i
t^ P(Y
Y
P(Y=v
Y=v^ .i^
) () |
( argmax
)
| ( argmax
(^11)
(^11)
vY Pv Yu Xu XP
u Xu Xv YP
Y^
mm
v
=
L
L
predict
) () |
( argmax
(^11)
vY Pv Yu Xu XP
mm
v
=
Estimating
the^ joint distribution of
X m
distribution
of^ X1 ,^ X
,^ …^ X m given^ y^ can
be^ problematic!
() | (
) |
(
(^111) 1
i mm i
i mm
vY u XP vY uX P
vY u Xu XP
=
=
L L
-^ T:^ Toothache
-^ C:^ Catch
-^ A:^ Cavity T and C are conditionally independent given A: P(T C|A) =P(T|A)*P(C|A)T and C^ are^ conditionally
So^ ,^ events
that^ are
not^ independent
from^ each
other^ might
be^ conditionally
independent
given^ some
fact p^
g It^ can^ also
happen
the^ other
way^ around.
Events^
that^ are
independent
might^ become
conditionally
dependent
given^ some
fact.
B=Burglar
in^ your^
house;^ A
=^ Alarm
( Burglar
)^ rang^ in
your^ house
E^ =^ Earthquake
happened B^ is^ independent
of^ E^ (ignoring
some^ possible
connections
between
them)
However,
if^ we^ know
A^ is^ true,
then^ B^
and^ E^ are
no^ longer
independent.
Why?
Knowing
E^ is^ true
makes^ it
much^ less
likely^ for
B^ to^ be^
true
-^ Assume
-^ Assume
-^ Learn
-^ Break
training
set^ into
n subsets Y^
called^ DS
DS^ based ny^
on
the^ y^ values,
i.e.,^ DS^ i
=^ Records
in^ which
Y=v^ i
-^ For^ each
DS^ ,^ learn i^
a^ joint^ distribution
of^ input
i mm
i mm i^
) () | () | ( argmax
(^11)
vY Pv Yu XP vY uX P Y^
mm
= =^
L
predict
v
Final Notes about
(Naïve)
Bayes
Classifier
Final
Notes
about
(Naïve)
Bayes
Classifier
-^ Any
density
estimator
can^ be
plugged
in^ to^ estimate
p(X^ ,X^1
, 2
X^ |y) or p(
X^ |y) for Naïve
bayes
…,^ Xm^
|y),^ or
p(X|y)i
for^ Naïve
bayes
-^ Real
valued
attributes
can^ be
modeled
using^
simple
distributions
such^ as
Gaussian
(Normal)
distribution
-^ Zero
probabilities
are^ painful
for^ both
joint^ and
naïve.
A^ hack
called Laplace smoothing can help!called
Laplace
smoothing
can^ help!
-^ Original
estimation: P(X^ =1|y=0)^1
-^ Smoothed
estimation
(never^ estimate
zero^ probability):
(#^ of^ examples
with^ y=0,
of^ examples
with^ y=0)
p^
y)
P(X^ =1|y=0)^1
= ( 1+ # of^ examples
with^ y=0,
k+^ #^ of^ examples
with^ y=0)
-^ Naïve Bayes is wonderfully cheap and survives tens of•^ Naïve
Bayes
is^ wonderfully
cheap
and^ survives
tens^ of
thousands
of^ attributes
easily
-^ Generative approach:Generative
approach:
-^ Learn
p(y),^ p(X|y),
and^ then
apply
bayes rule
to^ compute
p(y|X)
for^ making
predictions
-^ This
is^ in^ essence
assuming
that^ each
data^ point
is
independently,
identically
distributed
(i.i.d),
and^ generated
following a
generative process
governed by p(y) and
following
a^ generative
process
governed
by^ p(y)
and
p(X|y)
p(y)y (^) y Bayesclassifier
y^ p(y) Naïve^ Bayesclassifier p(X|y)X
classifier
X^ m
p(X^ |y)^1
p(X^ |y)m^
Given^ income,
savings,
predict^
loan^ applicant
as^ “high
risk”^ vs “low
risk”
Regression:
Given^ income,
savings,
predict^
credit^ score
try^ to
fit^ a^ straight
line
through
a^ clouds
of^ points L^ k f
[
]
-^ Look
for^ w=[w
,w,…,w^2
]m
ŷ^ =^ w
+w1x+…+w^1
xandmm^
ŷ^ is^ as
close^ to
y^ as^ possible
y
-^ Logistic
regression
can^ be
think^
of^ as
extension
of^ linear
regression
to^ the
case where the target value
y is
case^ where
the^ target
value
y^ is
binary x
-^ Given
a^ set^
of^ training
data^ points,
we^ would
like^ to
find^ a
i h^
h h^
weight
vector
w^ such
that
is^ large
(e.g.^ 1)
for^ positive
training
examples,
and^ small
)... (e.g.
xwmm xww
+++
0)^ otherwise • This^ can
be^ captured
in^ the
following
objective
function:
p^
g^ j
=^ ∑ i
ii y P L^
)| (log )(
w,x
w
Note^ that
the^ superscript
i^ is^ an^ index
to
the^ examples
in^ the^ training
set
∑^
= − −+ = =^ i
ii i ii i^
yP y yP y^
))]| (^1) ( (^1) log() (^1) () | (^1) ( log[
w,x
w,x
This is call the likelihood function of
w^ and by maximizing this objective function we
This^ is^ call
the^ likelihood
function
of^ w,^ and
by^ maximizing
this^ objective
function
,^ we
perform
what^ we
call^ “maximum
likelihood
estimation”
of^ the^ parameter
w.