p(category given observation) =
p(category) * p(observation given category) / p(observation)
p(observation given category) =
let p = 1 for feature in observation : p *= p(feature given category)
p(observation) =
let p = 1 for feature in observation: p *= p(feature)
p(feature) =
nb(observation with feature) / nb (all observation)
p(category) =
nb(observation labeled category) / nb (all observation)
p(featue given category) =
nb(observation with feature, labeled category) / nb (observation labeled category)
p(!feature) = 1 - p(feature)
if (feature in not observation) => feature in not observation