Skip to content
New issue

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

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

Already on GitHub? # to your account

Scale of bar graph does not change #226

Open
data-compute-geek opened this issue May 8, 2022 · 2 comments
Open

Scale of bar graph does not change #226

data-compute-geek opened this issue May 8, 2022 · 2 comments
Assignees

Comments

@data-compute-geek
Copy link

I am trying to use pyLDAvis to visualize the result of a topic modeling project. I notice that the scale of the axis for the frequency bar does not change when the length of the bars change as I slide the lambda dial. The visualization can be accessed here https://seanlog.com/tmp/lda_visualization_tutorial.html#topic=4&lambda=0&term=

For example, for topic 4, the frequency of christian is >2,000 when lambda is set at 0, and changes to ~ 1,500 when lambda is changed to 0.2.
image
image
My understanding is that changing the lambda only changes the order of the word, but not the overall or topic-specific frequencies. Shouldn't the scale of the axis for the bars change as lambda changes so as to keep the frequencies constant?

I used pyLDAvis.gensim_models.prepare to generate the visualization, and the code used to generate the visualization is available at https://github.com/data-compute-geek/pyLDAvis/blob/main/topic-modeling_tutorial.py

@chschroeder
Copy link

Same here. I am using pyLDAvis within a notebook:

import pyLDAvis
import pyLDAvis.sklearn

pyLDAvis.enable_notebook()

pyLDAvis.sklearn.prepare(topic_model, x_train, vectorizer)

where topic_model is an instance of sklearn.decomposition.LatentDirichletAllocation and vectorizer is a CountVectorizer.

@ldong87
Copy link

ldong87 commented Oct 6, 2022

This happens to me too. The frequency ticks are now static somehow.

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

No branches or pull requests

4 participants