Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
I'm trying to use the Predefined code in python 2.7 but whe I run the Setup and dataset loading code , I see an error
No module named pyLDAvis.sklearn ,
Do you know how to solve this?
Setup and dataset loading
First of all, let's load the libraries that we'll use.
import warnings # Disable some warnings
from dataiku import pandasutils as pdu
import pandas as pd, seaborn as sns
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.feature_extraction import text
from sklearn.decomposition import LatentDirichletAllocation,NMF
Populating the interactive namespace from numpy and matplotlib
ImportErrorTraceback (most recent call last)
<ipython-input-1-f0e756363047> in <module>()
10 from sklearn.decomposition import LatentDirichletAllocation,NMF
---> 11 import pyLDAvis.sklearn
ImportError: No module named pyLDAvis.sklearn
I fully recognize it's been over a year since you asked this question, but I just came across this and in the spirit of information sharing: any python error message saying "No module named..." indicates that either that package is misspelled, or the code environment used does not include this package.
The topic modeling plugin requires a python environment with NLP specific packages such as pyLDAvis, which are not included in DSS's built-in environment, which is likely what you were using.
You (or an admin, depending on your level of permissions) will need to first create a code environment that includes the packages imported at the top of the topic modeling notebook and then you'll want to change the notebook's code environment.