我在跟踪this tutorial
我得到的结果是系数的nan
。我的数据集有两列:tweets和摄取日期。我已经完全复制了代码,只是做了一些替换,比如tweet preprocessor。有什么想法吗?原始文件是否需要像教程中那样的target和target names列?在
# Build LDA model
lda_model = gensim.models.ldamodel.LdaModel(corpus=corpus,
id2word=id2word,
num_topics=20,
random_state=100,
update_every=1,
chunksize=100,
passes=10,
alpha='auto',
per_word_topics=True)
# Print the Keyword in the 10 topics
pprint(lda_model.print_topics())
doc_lda = lda_model[corpus]
[(0,
'nan*"fortnite" + nan*"louis" + nan*"yvr" + nan*"knowhttps" + '
'nan*"problematic" + nan*"zellepay" + nan*"ritual" + nan*"underway" + '
'nan*"mot" + nan*"tsb"'),
(1,
'nan*"fortnite" + nan*"louis" + nan*"yvr" + nan*"knowhttps" + '
'nan*"problematic" + nan*"zellepay" + nan*"ritual" + nan*"underway" + '
'nan*"mot" + nan*"tsb"'),
(2,
'nan*"fortnite" + nan*"louis" + nan*"yvr" + nan*"knowhttps" + '
'nan*"problematic" + nan*"zellepay" + nan*"ritual" + nan*"underway" + '
'nan*"mot" + nan*"tsb"'),
(3,
'nan*"fortnite" + nan*"louis" + nan*"yvr" + nan*"knowhttps" + '
'nan*"problematic" + nan*"zellepay" + nan*"ritual" + nan*"underway" + '
'nan*"mot" + nan*"tsb"'),
(4,...
我通过升级numpy到1.15.0版本来解决这个问题。在
不允许对你的问题发表评论,但我从同一个教程得到了同样的错误。我还没有看到任何解决办法,我也不知道会是什么问题。词组和预处理都是一样的,因为某些原因没有其他人得到这个错误。不过,我不认为这与目标名称有任何关系,因为有一次她将内容值转换成一个列表(我做的类似:
df.content.values.tolist())
)并专门处理这个问题更新:如果您遇到此问题,请升级您的numpy版本(这是一个numpy问题)。对我来说,conda install numpy=“1.14.5”有效。
相关问题 更多 >
编程相关推荐