dipanjanS/practical-machine-learning-with-python

PyLDAvis doesn't display anything

hisen630 opened this issue · 4 comments

hi, great book.
however, i followed all your instructions in chapter 7, the code pyLDAvis.sklearn.prepare(pos_nmf, ptvf_features, ptvf, R=15) displays nothing in my notebook. And i found this warning from jupyter console:

RuntimeWarning: invalid value encountered in multiply
  relevance = lambda_ * log_ttd + (1 - lambda_) * log_lift

i don't know if there's anything i can do to get the pic.
thanks


this should be a bug comes from pyLDAvis, following codes could work:

data = pyLDAvis.sklearn.prepare(pos_nmf, ptvf_features, ptvf, R=15)
pyLDAvis.show(data)

Hey @hisen630 ,

Thanks for the feedback. Glad you found the book useful, do share your feedback on amazon (it really encourages and would be highly appreciated).

Apologies for delayed response, we have been busy with some other projects.
Could you share python version /Anaconda installation details along with your import statements. We can take it from there.

In case you found the fix, do post how you handled it for the benefit of others.

Cheers.

Did you also execute pyLDAvis.enable_notebook() before running the other piece of code?

Please refer to http://nbviewer.jupyter.org/github/bmabey/hacker_news_topic_modelling/blob/master/HN%20Topic%20Model%20Talk.ipynb for a demo by the author of the package. If you use the enable_notebook() function then you don't need to use the show function explicitely. Do let us know if this worked or you still needed to use the show function and then we can check out if something changed in the library recently.

Closing this due to lack of further activity (> 1 month). Feel free to reach out in the future as needed or open a new issue in case of further problems.

trying with pyLDAvis.enable_notebook(local=True) worked for me