How to build a naive bayes classifier
alexn.org