cpsievert / LDAvis

R package for web-based interactive topic model visualization.
Other
557 stars 131 forks source link

Refactor Jensen-Shannon divergence calculation to handle small or zero probabilities #106

Open Jpowell94 opened 1 year ago

Jpowell94 commented 1 year ago

Adjusted the Jensen-Shannon divergence calculation in the jensenShannon function to address potential issues with small or zero probabilities. Introduced a small epsilon value (eps = 1e-10) to prevent taking the logarithm of zero and division by zero. This adjustment ensures stability and avoids errors in cases where probabilities are close to zero.

Jpowell94 commented 1 year ago

please let me know what you think and what I can do to help!