Sean: My version is verbose with lots of
notes. I broke a lot of stuff out into separate functions so I
could talk about what each bit is doing, and making the
correspondence as obvious as possible between the steps of k-means
and the steps of fitting a mixture model by EM.