finish porting naive_bayes process. references #29