Skip to main content
replaced http://stats.stackexchange.com/ with https://stats.stackexchange.com/
Source Link

I have been trying to implement a LDA program in python. So, far I have had little lucklittle luck. I have found this youtube video rather informative and easy to understand.

I am a programmer and I do not really understand weird mathematical notations, but here is what I collected.

  1. ndk = number of times in document, topic t was observed
  2. vkwdn = number of times in topic k, wdn was observed
  3. Assign topics randomly to each word in each document
  4. Count the number of times a word was used in a topic from all docs
  5. Count the number of times a document has a word of a particular topic
  6. Normalize the vectors in 4 and 5 for each topic
  7. Multiply M1[document][topic] with M2[topic][word] for each topic
  8. You should get a probability vector, having the probability for each topic
  9. Sample randomly using the vector as weights
  10. Assign it to the topic of that word in that document
  11. Go to step 4 unless everything has converged

I have been trying to implement a LDA program in python. So, far I have had little luck. I have found this youtube video rather informative and easy to understand.

I am a programmer and I do not really understand weird mathematical notations, but here is what I collected.

  1. ndk = number of times in document, topic t was observed
  2. vkwdn = number of times in topic k, wdn was observed
  3. Assign topics randomly to each word in each document
  4. Count the number of times a word was used in a topic from all docs
  5. Count the number of times a document has a word of a particular topic
  6. Normalize the vectors in 4 and 5 for each topic
  7. Multiply M1[document][topic] with M2[topic][word] for each topic
  8. You should get a probability vector, having the probability for each topic
  9. Sample randomly using the vector as weights
  10. Assign it to the topic of that word in that document
  11. Go to step 4 unless everything has converged

I have been trying to implement a LDA program in python. So, far I have had little luck. I have found this youtube video rather informative and easy to understand.

I am a programmer and I do not really understand weird mathematical notations, but here is what I collected.

  1. ndk = number of times in document, topic t was observed
  2. vkwdn = number of times in topic k, wdn was observed
  3. Assign topics randomly to each word in each document
  4. Count the number of times a word was used in a topic from all docs
  5. Count the number of times a document has a word of a particular topic
  6. Normalize the vectors in 4 and 5 for each topic
  7. Multiply M1[document][topic] with M2[topic][word] for each topic
  8. You should get a probability vector, having the probability for each topic
  9. Sample randomly using the vector as weights
  10. Assign it to the topic of that word in that document
  11. Go to step 4 unless everything has converged
Source Link

I have been trying to implement a LDA program in python. So, far I have had little luck. I have found this youtube video rather informative and easy to understand.

I am a programmer and I do not really understand weird mathematical notations, but here is what I collected.

  1. ndk = number of times in document, topic t was observed
  2. vkwdn = number of times in topic k, wdn was observed
  3. Assign topics randomly to each word in each document
  4. Count the number of times a word was used in a topic from all docs
  5. Count the number of times a document has a word of a particular topic
  6. Normalize the vectors in 4 and 5 for each topic
  7. Multiply M1[document][topic] with M2[topic][word] for each topic
  8. You should get a probability vector, having the probability for each topic
  9. Sample randomly using the vector as weights
  10. Assign it to the topic of that word in that document
  11. Go to step 4 unless everything has converged