full LDA model and various inference helpers, starting on KNN