python - 协作主题建模的简单 Python 实现?

标签 python machine-learning lda topic-modeling collaborative-filtering

我遇到了这两篇结合协同过滤(矩阵分解)和主题建模(LDA)的论文,根据用户感兴趣的帖子/文章的主题术语向用户推荐相似的文章/帖子。

论文(PDF)是: “ Collaborative Topic Modeling for Recommending Scientific Articles ”和 " Collaborative Topic Modeling for Recommending GitHub Repositories "

新算法称为协作主题回归。我希望找到一些实现这一点的python代码,但无济于事。这可能是一个很长的镜头,但有人可以展示一个简单的 python 示例吗?

最佳答案

这应该可以帮助您入门(尽管不确定为什么尚未发布):https://github.com/arongdari/python-topic-model

更具体地说:https://github.com/arongdari/python-topic-model/blob/master/ptm/collabotm.py

class CollaborativeTopicModel:
    """
    Wang, Chong, and David M. Blei. "Collaborative topic 
                                modeling for recommending scientific articles."
    Proceedings of the 17th ACM SIGKDD international conference on Knowledge
                                discovery and data mining. ACM, 2011.
    Attributes
    ----------
    n_item: int
        number of items
    n_user: int
        number of users
    R: ndarray, shape (n_user, n_item)
        user x item rating matrix
    """

看起来漂亮而简单。我仍然建议至少看看 gensim。 Radim 在优化该软件方面做得非常出色。

关于python - 协作主题建模的简单 Python 实现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32215827/

相关文章:

r - LDA交叉验证和变量选择

python - 超时功能,如果完成时间过长

python - 使用 SSH 时仅在终止时显示 python 脚本的输出?

python - 有没有办法使用找到的顺序模式作为聚类算法的输入

python - 如何使用pickle保存聊天机器人模型

python - SKlearn LDA 与 Gensim LDA 中的困惑度比较问题

python - Python 中列表的语法

python - 从 numPy 数组列表中删除重复项

machine-learning - 如何在arff文件中表示n-gram特征?

r - 在 R tm 包中,从 Document-Term-Matrix 构建语料库