动态主题模型
项目描述
horizont实现了一系列主题模型。遵循scikit-learn的约定。
以下模型使用吉布斯采样实现。
潜在狄利克雷分配 (Blei et al., 2003; Pritchard et al., 2000)
(即将推出) 逻辑正态主题模型
(即将推出) 动态主题模型 (Blei and Lafferty, 2006)
入门指南
horizont.LDA使用吉布斯采样实现潜在狄利克雷分配 (LDA),其接口遵循scikit-learn的约定。
>>> import numpy as np
>>> from horizont import LDA
>>> X = np.array([[1,1], [2, 1], [3, 1], [4, 1], [5, 8], [6, 1]])
>>> model = LDA(n_topics=2, random_state=0, n_iter=100)
>>> doc_topic = model.fit_transform(X) # estimate of document-topic distributions
>>> model.components_ # estimate of topic-word distributions
要求
需要Python 2.7或Python 3.3+。还需要以下软件包
futures (仅限Python 2.7)
GSL是Pólya-Gamma随机变量发生器内部生成随机数所必需的。在基于Debian的系统上,可以使用以下命令安装GSL:sudo apt-get install libgsl0-dev。horizont将在/usr/include和/usr/lib中分别查找GSL头文件和库。
如果从源代码编译,则需要Cython。
重要链接
许可证
horizont 项目遵循 GNU 通用公共许可证第 3.0 版。请参阅 LICENSE 文件以获取许可证文本或访问 https://gnu.ac.cn/copyleft/gpl.html。
项目详情
关闭
horizont-0.0.5.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 1af2470d7524a4b15f2a1d74a07df63e5f52327a2a22f894be3c3a84af61ec7d |
|
MD5 | 74e598d35503f699766b8a705e53eee0 |
|
BLAKE2b-256 | 3c9eb2959b398b7d2b6c089ccc9a1f6f262d4df76eb79ca1576c9b7139043698 |