跳转到主要内容

狄利克雷过程工具

项目描述

dirichlet
=========

[![image](https://img.shields.io/travis/tdhopper/dirichlet.svg)](https://travis-ci.org/tdhopper/dirichlet)

[![image](https://img.shields.io/pypi/v/dirichlet.svg)](https://pypi.python.org/pypi/dirichlet)

从任何随机采样器构建 [狄利克雷过程](https://github.com/tdhopper/notes-on-dirichlet-processes)。

```
In [1]: from dp import DirichletProcess

In [2]: from random import normalvariate

In [3]: from collections import Counter

In [4]: dp = DirichletProcess(lambda: normalvariate(0, 1), alpha=1)

In [7]: Counter(dp() for _ in range(1000))
Out[7]: Counter({-0.029073686274754998: 679, 0.7332646430104509: 301, 0.23296111210571477: 12, -0.7042044460111074: 4, -2.2504937687943922: 4})
```

使用`pip install dirichletprocess`或`conda install -c tdhopper dirichletprocess`安装。

历史
=======

0.2.0 (2015-08-13)
==================

- 添加基本功能。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源分布

dirichletprocess-0.2.0.tar.gz (12.4 kB 查看哈希值)

上传于 来源

构建版本

dirichletprocess-0.2.0-py2-none-any.whl (4.0 kB 查看哈希值)

上传于 Python 2

由以下机构支持