Predefined code Notebooks Python Topic modeling
![unbbmas](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar16.png)
Hello,
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?
Thanks
Setup and dataset loading
First of all, let's load the libraries that we'll use.
This notebook requires the installation of the pyLDAvis package. See here for help with intalling python packages.
In [1]:
%pylab inline
import warnings # Disable some warnings
warnings.filterwarnings("ignore",category=DeprecationWarning)
import dataiku
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
import pyLDAvis.sklearn
pyLDAvis.enable_notebook()
Populating the interactive namespace from numpy and matplotlib
ImportErrorTraceback (most recent call last)
<ipython-input-1-f0e756363047> in <module>()
9
10 from sklearn.decomposition import LatentDirichletAllocation,NMF
---> 11 import pyLDAvis.sklearn
12 pyLDAvis.enable_notebook()
ImportError: No module named pyLDAvis.sklearn
Answers
-
Hello!
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.
Best,
Katie