<s>
In	O
statistics	O
,	O
naive	B-General_Concept
Bayes	I-General_Concept
classifiers	I-General_Concept
are	O
a	O
family	O
of	O
simple	O
"	O
probabilistic	B-General_Concept
classifiers	I-General_Concept
"	O
based	O
on	O
applying	O
Bayes	O
 '	O
theorem	O
with	O
strong	O
(	O
naive	O
)	O
independence	O
assumptions	O
between	O
the	O
features	O
(	O
see	O
Bayes	B-General_Concept
classifier	I-General_Concept
)	O
.	O
</s>
<s>
They	O
are	O
among	O
the	O
simplest	O
Bayesian	O
network	O
models	O
,	O
but	O
coupled	O
with	O
kernel	B-General_Concept
density	I-General_Concept
estimation	I-General_Concept
,	O
they	O
can	O
achieve	O
high	O
accuracy	O
levels	O
.	O
</s>
<s>
Naive	B-General_Concept
Bayes	I-General_Concept
classifiers	I-General_Concept
are	O
highly	O
scalable	O
,	O
requiring	O
a	O
number	O
of	O
parameters	O
linear	O
in	O
the	O
number	O
of	O
variables	O
(	O
features/predictors	O
)	O
in	O
a	O
learning	O
problem	O
.	O
</s>
<s>
Maximum-likelihood	O
training	O
can	O
be	O
done	O
by	O
evaluating	O
a	O
closed-form	O
expression	O
,	O
which	O
takes	O
linear	O
time	O
,	O
rather	O
than	O
by	O
expensive	O
iterative	B-Algorithm
approximation	I-Algorithm
as	O
used	O
for	O
many	O
other	O
types	O
of	O
classifiers	B-General_Concept
.	O
</s>
<s>
In	O
the	O
statistics	O
literature	O
,	O
naive	B-General_Concept
Bayes	I-General_Concept
models	I-General_Concept
are	O
known	O
under	O
a	O
variety	O
of	O
names	O
,	O
including	O
simple	O
Bayes	O
and	O
independence	O
Bayes	O
.	O
</s>
<s>
All	O
these	O
names	O
reference	O
the	O
use	O
of	O
Bayes	O
 '	O
theorem	O
in	O
the	O
classifier	B-General_Concept
's	O
decision	O
rule	O
,	O
but	O
naive	B-General_Concept
Bayes	I-General_Concept
is	O
not	O
(	O
necessarily	O
)	O
a	O
Bayesian	O
method	O
.	O
</s>
<s>
Naive	B-General_Concept
Bayes	I-General_Concept
is	O
a	O
simple	O
technique	O
for	O
constructing	O
classifiers	B-General_Concept
:	O
models	O
that	O
assign	O
class	O
labels	O
to	O
problem	O
instances	O
,	O
represented	O
as	O
vectors	O
of	O
feature	B-Algorithm
values	O
,	O
where	O
the	O
class	O
labels	O
are	O
drawn	O
from	O
some	O
finite	O
set	O
.	O
</s>
<s>
There	O
is	O
not	O
a	O
single	O
algorithm	O
for	O
training	O
such	O
classifiers	B-General_Concept
,	O
but	O
a	O
family	O
of	O
algorithms	O
based	O
on	O
a	O
common	O
principle	O
:	O
all	O
naive	B-General_Concept
Bayes	I-General_Concept
classifiers	I-General_Concept
assume	O
that	O
the	O
value	O
of	O
a	O
particular	O
feature	B-Algorithm
is	O
independent	O
of	O
the	O
value	O
of	O
any	O
other	O
feature	B-Algorithm
,	O
given	O
the	O
class	O
variable	O
.	O
</s>
<s>
A	O
naive	B-General_Concept
Bayes	I-General_Concept
classifier	I-General_Concept
considers	O
each	O
of	O
these	O
features	O
to	O
contribute	O
independently	O
to	O
the	O
probability	O
that	O
this	O
fruit	O
is	O
an	O
apple	O
,	O
regardless	O
of	O
any	O
possible	O
correlations	O
between	O
the	O
color	O
,	O
roundness	O
,	O
and	O
diameter	O
features	O
.	O
</s>
<s>
In	O
many	O
practical	O
applications	O
,	O
parameter	O
estimation	O
for	O
naive	B-General_Concept
Bayes	I-General_Concept
models	I-General_Concept
uses	O
the	O
method	O
of	O
maximum	O
likelihood	O
;	O
in	O
other	O
words	O
,	O
one	O
can	O
work	O
with	O
the	O
naive	B-General_Concept
Bayes	I-General_Concept
model	I-General_Concept
without	O
accepting	O
Bayesian	O
probability	O
or	O
using	O
any	O
Bayesian	O
methods	O
.	O
</s>
<s>
Despite	O
their	O
naive	O
design	O
and	O
apparently	O
oversimplified	O
assumptions	O
,	O
naive	B-General_Concept
Bayes	I-General_Concept
classifiers	I-General_Concept
have	O
worked	O
quite	O
well	O
in	O
many	O
complex	O
real-world	O
situations	O
.	O
</s>
<s>
In	O
2004	O
,	O
an	O
analysis	O
of	O
the	O
Bayesian	B-General_Concept
classification	I-General_Concept
problem	O
showed	O
that	O
there	O
are	O
sound	O
theoretical	O
reasons	O
for	O
the	O
apparently	O
implausible	O
efficacy	O
of	O
naive	B-General_Concept
Bayes	I-General_Concept
classifiers	I-General_Concept
.	O
</s>
<s>
Still	O
,	O
a	O
comprehensive	O
comparison	O
with	O
other	O
classification	O
algorithms	O
in	O
2006	O
showed	O
that	O
Bayes	O
classification	O
is	O
outperformed	O
by	O
other	O
approaches	O
,	O
such	O
as	O
boosted	O
trees	O
or	O
random	B-Algorithm
forests	I-Algorithm
.	O
</s>
<s>
An	O
advantage	O
of	O
naive	B-General_Concept
Bayes	I-General_Concept
is	O
that	O
it	O
only	O
requires	O
a	O
small	O
number	O
of	O
training	O
data	O
to	O
estimate	O
the	O
parameters	O
necessary	O
for	O
classification	O
.	O
</s>
<s>
Abstractly	O
,	O
naive	B-General_Concept
Bayes	I-General_Concept
is	O
a	O
conditional	O
probability	O
model	O
:	O
it	O
assigns	O
probabilities	O
for	O
each	O
of	O
the	O
possible	O
outcomes	O
or	O
classes	O
given	O
a	O
problem	O
instance	O
to	O
be	O
classified	O
,	O
represented	O
by	O
a	O
vector	O
encoding	O
some	O
features	O
(	O
independent	O
variables	O
)	O
.	O
</s>
<s>
The	O
problem	O
with	O
the	O
above	O
formulation	O
is	O
that	O
if	O
the	O
number	O
of	O
features	O
is	O
large	O
or	O
if	O
a	O
feature	B-Algorithm
can	O
take	O
on	O
a	O
large	O
number	O
of	O
values	O
,	O
then	O
basing	O
such	O
a	O
model	O
on	O
probability	O
tables	O
is	O
infeasible	O
.	O
</s>
<s>
where	O
the	O
evidence	O
is	O
a	O
scaling	O
factor	O
dependent	O
only	O
on	O
,	O
that	O
is	O
,	O
a	O
constant	O
if	O
the	O
values	O
of	O
the	O
feature	B-Algorithm
variables	O
are	O
known	O
.	O
</s>
<s>
The	O
discussion	O
so	O
far	O
has	O
derived	O
the	O
independent	O
feature	B-Algorithm
model	O
,	O
that	O
is	O
,	O
the	O
naive	B-General_Concept
Bayes	I-General_Concept
probability	O
model	O
.	O
</s>
<s>
The	O
naive	B-General_Concept
Bayes	I-General_Concept
classifier	I-General_Concept
combines	O
this	O
model	O
with	O
a	O
decision	O
rule	O
.	O
</s>
<s>
One	O
common	O
rule	O
is	O
to	O
pick	O
the	O
hypothesis	O
that	O
is	O
most	O
probable	O
so	O
as	O
to	O
minimize	O
the	O
probability	O
of	O
misclassification	O
;	O
this	O
is	O
known	O
as	O
the	O
maximum	B-General_Concept
a	I-General_Concept
posteriori	I-General_Concept
or	O
MAP	O
decision	O
rule	O
.	O
</s>
<s>
The	O
corresponding	O
classifier	B-General_Concept
,	O
a	O
Bayes	B-General_Concept
classifier	I-General_Concept
,	O
is	O
the	O
function	O
that	O
assigns	O
a	O
class	O
label	O
for	O
some	O
as	O
follows	O
:	O
</s>
<s>
To	O
estimate	O
the	O
parameters	O
for	O
a	O
feature	B-Algorithm
's	O
distribution	O
,	O
one	O
must	O
assume	O
a	O
distribution	O
or	O
generate	O
nonparametric	B-General_Concept
models	I-General_Concept
for	O
the	O
features	O
from	O
the	O
training	O
set	O
.	O
</s>
<s>
The	O
assumptions	O
on	O
distributions	O
of	O
features	O
are	O
called	O
the	O
"	O
event	O
model	O
"	O
of	O
the	O
naive	B-General_Concept
Bayes	I-General_Concept
classifier	I-General_Concept
.	O
</s>
<s>
For	O
discrete	O
features	O
like	O
the	O
ones	O
encountered	O
in	O
document	B-Algorithm
classification	I-Algorithm
(	O
include	O
spam	O
filtering	O
)	O
,	O
multinomial	O
and	O
Bernoulli	O
distributions	O
are	O
popular	O
.	O
</s>
<s>
Let	O
be	O
the	O
mean	O
of	O
the	O
values	O
in	O
associated	O
with	O
class	O
,	O
and	O
let	O
be	O
the	O
Bessel	B-General_Concept
corrected	I-General_Concept
variance	I-General_Concept
of	O
the	O
values	O
in	O
associated	O
with	O
class	O
.	O
</s>
<s>
Another	O
common	O
technique	O
for	O
handling	O
continuous	O
values	O
is	O
to	O
use	O
binning	O
to	O
discretize	O
the	O
feature	B-Algorithm
values	O
and	O
obtain	O
a	O
new	O
set	O
of	O
Bernoulli-distributed	O
features	O
.	O
</s>
<s>
Some	O
literature	O
suggests	O
that	O
this	O
is	O
required	O
in	O
order	O
to	O
use	O
naive	B-General_Concept
Bayes	I-General_Concept
,	O
but	O
it	O
is	O
not	O
true	O
,	O
as	O
the	O
discretization	O
may	O
throw	B-Algorithm
away	I-Algorithm
discriminative	I-Algorithm
information	I-Algorithm
.	O
</s>
<s>
In	O
these	O
cases	O
,	O
kernel	B-General_Concept
density	I-General_Concept
estimation	I-General_Concept
can	O
be	O
used	O
for	O
a	O
more	O
realistic	O
estimate	O
of	O
the	O
marginal	O
densities	O
of	O
each	O
class	O
.	O
</s>
<s>
This	O
method	O
,	O
which	O
was	O
introduced	O
by	O
John	O
and	O
Langley	O
,	O
can	O
boost	O
the	O
accuracy	O
of	O
the	O
classifier	B-General_Concept
considerably	O
.	O
</s>
<s>
With	O
a	O
multinomial	O
event	O
model	O
,	O
samples	O
(	O
feature	B-Algorithm
vectors	I-Algorithm
)	O
represent	O
the	O
frequencies	O
with	O
which	O
certain	O
events	O
have	O
been	O
generated	O
by	O
a	O
multinomial	O
where	O
is	O
the	O
probability	O
that	O
event	O
occurs	O
(	O
or	O
such	O
multinomials	O
in	O
the	O
multiclass	O
case	O
)	O
.	O
</s>
<s>
A	O
feature	B-Algorithm
vector	I-Algorithm
is	O
then	O
a	O
histogram	B-Algorithm
,	O
with	O
counting	O
the	O
number	O
of	O
times	O
event	O
was	O
observed	O
in	O
a	O
particular	O
instance	O
.	O
</s>
<s>
This	O
is	O
the	O
event	O
model	O
typically	O
used	O
for	O
document	B-Algorithm
classification	I-Algorithm
,	O
with	O
events	O
representing	O
the	O
occurrence	O
of	O
a	O
word	O
in	O
a	O
single	O
document	O
(	O
see	O
bag	B-General_Concept
of	I-General_Concept
words	I-General_Concept
assumption	I-General_Concept
)	O
.	O
</s>
<s>
The	O
likelihood	O
of	O
observing	O
a	O
histogram	B-Algorithm
is	O
given	O
by	O
:	O
</s>
<s>
The	O
multinomial	O
naive	B-General_Concept
Bayes	I-General_Concept
classifier	I-General_Concept
becomes	O
a	O
linear	B-General_Concept
classifier	I-General_Concept
when	O
expressed	O
in	O
log-space	O
:	O
</s>
<s>
If	O
a	O
given	O
class	O
and	O
feature	B-Algorithm
value	O
never	O
occur	O
together	O
in	O
the	O
training	O
data	O
,	O
then	O
the	O
frequency-based	O
probability	O
estimate	O
will	O
be	O
zero	O
,	O
because	O
the	O
probability	O
estimate	O
is	O
directly	O
proportional	O
to	O
the	O
number	O
of	O
occurrences	O
of	O
a	O
feature	B-Algorithm
's	O
value	O
.	O
</s>
<s>
This	O
way	O
of	O
regularizing	O
naive	B-General_Concept
Bayes	I-General_Concept
is	O
called	O
Laplace	O
smoothing	O
when	O
the	O
pseudocount	O
is	O
one	O
,	O
and	O
Lidstone	O
smoothing	O
in	O
the	O
general	O
case	O
.	O
</s>
<s>
discuss	O
problems	O
with	O
the	O
multinomial	O
assumption	O
in	O
the	O
context	O
of	O
document	B-Algorithm
classification	I-Algorithm
and	O
possible	O
ways	O
to	O
alleviate	O
those	O
problems	O
,	O
including	O
the	O
use	O
of	O
tf	O
–	O
idf	O
weights	O
instead	O
of	O
raw	O
term	O
frequencies	O
and	O
document	O
length	O
normalization	O
,	O
to	O
produce	O
a	O
naive	B-General_Concept
Bayes	I-General_Concept
classifier	I-General_Concept
that	O
is	O
competitive	O
with	O
support	B-Algorithm
vector	I-Algorithm
machines	I-Algorithm
.	O
</s>
<s>
Like	O
the	O
multinomial	O
model	O
,	O
this	O
model	O
is	O
popular	O
for	O
document	B-Algorithm
classification	I-Algorithm
tasks	O
,	O
where	O
binary	O
term	O
occurrence	O
features	O
are	O
used	O
rather	O
than	O
term	O
frequencies	O
.	O
</s>
<s>
Note	O
that	O
a	O
naive	B-General_Concept
Bayes	I-General_Concept
classifier	I-General_Concept
with	O
a	O
Bernoulli	O
event	O
model	O
is	O
not	O
the	O
same	O
as	O
a	O
multinomial	O
NB	O
classifier	B-General_Concept
with	O
frequency	O
counts	O
truncated	O
to	O
one	O
.	O
</s>
<s>
Given	O
a	O
way	O
to	O
train	O
a	O
naive	B-General_Concept
Bayes	I-General_Concept
classifier	I-General_Concept
from	O
labeled	O
data	O
,	O
it	O
's	O
possible	O
to	O
construct	O
a	O
semi-supervised	B-General_Concept
training	O
algorithm	O
that	O
can	O
learn	O
from	O
a	O
combination	O
of	O
labeled	O
and	O
unlabeled	O
data	O
by	O
running	O
the	O
supervised	O
learning	O
algorithm	O
in	O
a	O
loop	O
:	O
</s>
<s>
Given	O
a	O
collection	O
of	O
labeled	O
samples	O
and	O
unlabeled	O
samples	O
,	O
start	O
by	O
training	O
a	O
naive	B-General_Concept
Bayes	I-General_Concept
classifier	I-General_Concept
on	O
.	O
</s>
<s>
Convergence	O
is	O
determined	O
based	O
on	O
improvement	O
to	O
the	O
model	O
likelihood	O
,	O
where	O
denotes	O
the	O
parameters	O
of	O
the	O
naive	B-General_Concept
Bayes	I-General_Concept
model	I-General_Concept
.	O
</s>
<s>
This	O
training	O
algorithm	O
is	O
an	O
instance	O
of	O
the	O
more	O
general	O
expectation	B-Algorithm
–	I-Algorithm
maximization	I-Algorithm
algorithm	I-Algorithm
(	O
EM	O
)	O
:	O
the	O
prediction	O
step	O
inside	O
the	O
loop	O
is	O
the	O
E-step	O
of	O
EM	O
,	O
while	O
the	O
re-training	O
of	O
naive	B-General_Concept
Bayes	I-General_Concept
is	O
the	O
M-step	O
.	O
</s>
<s>
Despite	O
the	O
fact	O
that	O
the	O
far-reaching	O
independence	O
assumptions	O
are	O
often	O
inaccurate	O
,	O
the	O
naive	B-General_Concept
Bayes	I-General_Concept
classifier	I-General_Concept
has	O
several	O
properties	O
that	O
make	O
it	O
surprisingly	O
useful	O
in	O
practice	O
.	O
</s>
<s>
In	O
particular	O
,	O
the	O
decoupling	O
of	O
the	O
class	O
conditional	O
feature	B-Algorithm
distributions	O
means	O
that	O
each	O
distribution	O
can	O
be	O
independently	O
estimated	O
as	O
a	O
one-dimensional	O
distribution	O
.	O
</s>
<s>
This	O
helps	O
alleviate	O
problems	O
stemming	O
from	O
the	O
curse	B-Algorithm
of	I-Algorithm
dimensionality	I-Algorithm
,	O
such	O
as	O
the	O
need	O
for	O
data	O
sets	O
that	O
scale	O
exponentially	O
with	O
the	O
number	O
of	O
features	O
.	O
</s>
<s>
While	O
naive	B-General_Concept
Bayes	I-General_Concept
often	O
fails	O
to	O
produce	O
a	O
good	O
estimate	O
for	O
the	O
correct	O
class	O
probabilities	O
,	O
this	O
may	O
not	O
be	O
a	O
requirement	O
for	O
many	O
applications	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
naive	B-General_Concept
Bayes	I-General_Concept
classifier	I-General_Concept
will	O
make	O
the	O
correct	O
MAP	O
decision	O
rule	O
classification	O
so	O
long	O
as	O
the	O
correct	O
class	O
is	O
predicted	O
as	O
more	O
probable	O
than	O
any	O
other	O
class	O
.	O
</s>
<s>
In	O
this	O
manner	O
,	O
the	O
overall	O
classifier	B-General_Concept
can	O
be	O
robust	O
enough	O
to	O
ignore	O
serious	O
deficiencies	O
in	O
its	O
underlying	O
naive	O
probability	O
model	O
.	O
</s>
<s>
Other	O
reasons	O
for	O
the	O
observed	O
success	O
of	O
the	O
naive	B-General_Concept
Bayes	I-General_Concept
classifier	I-General_Concept
are	O
discussed	O
in	O
the	O
literature	O
cited	O
below	O
.	O
</s>
<s>
In	O
the	O
case	O
of	O
discrete	O
inputs	O
(	O
indicator	O
or	O
frequency	O
features	O
for	O
discrete	O
events	O
)	O
,	O
naive	B-General_Concept
Bayes	I-General_Concept
classifiers	I-General_Concept
form	O
a	O
generative-discriminative	O
pair	O
with	O
multinomial	O
logistic	O
regression	O
classifiers	B-General_Concept
:	O
each	O
naive	B-General_Concept
Bayes	I-General_Concept
classifier	I-General_Concept
can	O
be	O
considered	O
a	O
way	O
of	O
fitting	O
a	O
probability	O
model	O
that	O
optimizes	O
the	O
joint	O
likelihood	O
,	O
while	O
logistic	O
regression	O
fits	O
the	O
same	O
probability	O
model	O
to	O
optimize	O
the	O
conditional	O
.	O
</s>
<s>
The	O
link	O
between	O
the	O
two	O
can	O
be	O
seen	O
by	O
observing	O
that	O
the	O
decision	O
function	O
for	O
naive	B-General_Concept
Bayes	I-General_Concept
(	O
in	O
the	O
binary	O
case	O
)	O
can	O
be	O
rewritten	O
as	O
"	O
predict	O
class	O
if	O
the	O
odds	O
of	O
exceed	O
those	O
of	O
"	O
.	O
</s>
<s>
Since	O
naive	B-General_Concept
Bayes	I-General_Concept
is	O
also	O
a	O
linear	O
model	O
for	O
the	O
two	O
"	O
discrete	O
"	O
event	O
models	O
,	O
it	O
can	O
be	O
reparametrised	O
as	O
a	O
linear	O
function	O
.	O
</s>
<s>
Obtaining	O
the	O
probabilities	O
is	O
then	O
a	O
matter	O
of	O
applying	O
the	O
logistic	O
function	O
to	O
,	O
or	O
in	O
the	O
multiclass	O
case	O
,	O
the	O
softmax	B-Algorithm
function	I-Algorithm
.	O
</s>
<s>
Discriminative	O
classifiers	B-General_Concept
have	O
lower	O
asymptotic	O
error	O
than	O
generative	O
ones	O
;	O
however	O
,	O
research	O
by	O
Ng	O
and	O
Jordan	O
has	O
shown	O
that	O
in	O
some	O
practical	O
cases	O
naive	B-General_Concept
Bayes	I-General_Concept
can	O
outperform	O
logistic	O
regression	O
because	O
it	O
reaches	O
its	O
asymptotic	O
error	O
faster	O
.	O
</s>
<s>
Although	O
with	O
NB	O
classifier	B-General_Concept
we	O
treat	O
them	O
as	O
independent	O
,	O
they	O
are	O
not	O
in	O
reality	O
.	O
</s>
<s>
The	O
classifier	B-General_Concept
created	O
from	O
the	O
training	O
set	O
using	O
a	O
Gaussian	O
distribution	O
assumption	O
would	O
be	O
(	O
given	O
variances	O
are	O
unbiased	O
sample	O
variances	O
)	O
:	O
</s>
<s>
Here	O
is	O
a	O
worked	O
example	O
of	O
naive	B-General_Concept
Bayesian	I-General_Concept
classification	I-General_Concept
to	O
the	O
document	B-Algorithm
classification	I-Algorithm
problem	O
.	O
</s>
<s>
(	O
This	O
technique	O
of	O
"	O
log-likelihood	B-General_Concept
ratios	I-General_Concept
"	O
is	O
a	O
common	O
technique	O
in	O
statistics	O
.	O
</s>
<s>
In	O
the	O
case	O
of	O
two	O
mutually	O
exclusive	O
alternatives	O
(	O
such	O
as	O
this	O
example	O
)	O
,	O
the	O
conversion	O
of	O
a	O
log-likelihood	B-General_Concept
ratio	I-General_Concept
to	O
a	O
probability	O
takes	O
the	O
form	O
of	O
a	O
sigmoid	B-Algorithm
curve	I-Algorithm
:	O
see	O
logit	O
for	O
details	O
.	O
)	O
</s>
