Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong calculation of perplexity? #1

Open
marcelopita opened this issue Jul 30, 2015 · 1 comment
Open

Wrong calculation of perplexity? #1

marcelopita opened this issue Jul 30, 2015 · 1 comment

Comments

@marcelopita
Copy link

Hi,
First of all, thank you for the code for test perplexity calculation extending the GibbsLDA++. It will be very useful for my work.
I am observing the calculation of perplexity and it seems that you are applying the logarithm before the sum of all words probabilities in the document. Since the sum of logs is not equivalent the the log of sum, and the perplexity function takes into account the log of sum, your calculation may be incorrect.
Is my observation relevant?
Cheers,
Marcelo Pita

@koljamaier
Copy link

Hi Marcelo,

I had the same intuition like you. But indeed, the calculation in the code is correct.
You might have heard of the famous paper "Parameter estimation for text analysis". In section 7.3 there is a detailed derivation for LDA-perplexity. And in fact it turns out that you log the single term-probabilities.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants