Implementation of LDA in python