跳转到主要内容

动态主题模型

项目描述

https://travis-ci.org/ariddell/horizont.png

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+。还需要以下软件包

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 (1.3 MB 查看哈希值)

上传时间 源代码

由...