我已经完成了 LDA 主题建模并将其存储在lda_model.
转换我的原始输入数据集后,我检索了一个 DataFrame。其中一列是 topicDistribution,其中该行属于 LDA 模型中每个主题的概率。因此,我想获取每行列表中最大值的索引。
df -- | 'list_of_words' | 'index ' | 'topicDistribution' |
['product','...'] 0 [0.08,0.2,0.4,0.0001]
..... ... ........
我想转换 df 以便添加一个附加列,它是每行 topicDistribution 列表的 argmax。
df_transformed -- | 'list_of_words' | 'index' | 'topicDistribution' | 'topicID' |
['product','...'] 0 [0.08,0.2,0.4,0.0001] 2
...... .... ..... ....
我该怎么做?
开心每一天1111
qq_花开花谢_0
随时随地看视频慕课网APP
相关分类