信息论的python包。
dit的Python项目详细描述
`` dit``是一个信息理论的python软件包。
/>
导论对概率论和统计学来说,量化任意随机变量之间的依赖性
,使其在系统和尺度上具有一致性和可比性。信息论最初是为了量化信息在任意信道中传输的速度和可靠性。现代数据驱动科学的需求一直在协调这些数量和方法,并将其扩展到未知的多变量环境中,在这些环境中,解释和最佳实践是未知的。例如,至少有四种合理的相互信息的多元推广,它们都没有继承标准二元情形的所有解释。最好使用的是上下文相关的。`` dit``
实现了大量的多元信息度量,以使信息
实践者能够研究这些不同度量在各种上下文中的行为和交互。我们希望在一个地方实现所有这些度量和技术,将允许开发健壮的技术来自动量化系统中的依赖项,并具体解释这些依赖项意思是。
日志{开源软件日志},
卷{3},
号{25},
页{738},
年{2018},
doi={https://doi.org/10.21105/joss.00738}
}
basic信息
---------
文档
********
>下载
*****
|
==========================================================>===========================================================================================================================================`contextlib2<;https://contextlib2.readthedocs.io>;`
*`DebtCollector<;https://docs.openstack.org/DebtCollector/>;`
*`networkx<;https://networkx.github.io/>;`
*`numpy<;http://www.numpy.org/>;`|
*`prettytable<;https://code.google.com/archive/p/prettytable/>;`
*`scipy<;https://www.scipy.org/>;`
*`six<;http://pythonhosted.org/six/>;`|
+—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————分布的随机抽样
*matplotlib,python threental:绘制各种信息论展开式
*numdifftools:优化期间梯度和黑森的数值计算
*pint:将单位添加到信息值中
*scikit learn:熵/互信息估计期间更快的近邻查找从示例
安装
**
最简单的安装方法是:
…代码块::bash
``编辑``目录,然后安装包:
…代码块::bash
git克隆https://github.com/dit/dit.git
cd dit
pip安装。
…注意:
windows当前不支持cython扩展。请使用`--nocython``选项安装
。
代码块::shell
$git clone https://github.com/dit/dit.git
$cd dit
$pip install-r requirements\u testing.txt
$py.test
code and bug tracker
***********
*****
实现的度量值
---------
``dit``实现以下信息度量值。其中大多数是在多元条件的一般性中实现的,这些一般性要么存在于文献中,要么相对明显,例如,尽管文献中没有。多变量条件精确公共信息在这里实现。
+---------------------------+---------------------------+---------------------------+---------------------------+
熵互信息|分歧
*香农熵*协信息*变分距离
|*仁义熵*相互作用信息*库尔贝克-莱布勒散度
*tsallis熵*总相关/相对熵
*必要条件熵|多信息*交叉熵
*剩余熵*双总相关*jensen-shannon散度
独立信息绑定信息|*地球运动距离
信息变化*caekl多元互信息+---------------------------+
+---------------------------++其他测度
|公共信息部分信息分解
*信道容量
*gacs-korner公共信息|*:math:`i{min}`*复杂性配置文件
*wyner公共信息*:math:`i{\wedge}`*连接信息
*精确公共信息*:math:`i{\downarrow}`|*累积剩余熵
*函数公共信息*:数学:`i{proj}`*extropy
*mss公共信息*:数学:`i{broja}`*hypercontractive系数|
+---------------------------+*:数学:`i{ccs}`*信息瓶颈
密钥协议界限*:数学:`i{\pm}`*信息图
||*:math:`i{dep}`*信息修剪
*内部互信息*:math:`i{rav}`*LAUTUM信息
*减少内部互信息||*lmpr复杂性|
*最小内在互信息*信息边际效用
*必要内在互信息*最大关联
*保密能力||*最大熵分布|||*率失真理论|
+--------------------------------+--------------------------------+--------------------------------+
quickstart
-------
dit的基本用法对应于创建发行版,根据需要修改发行版,然后计算属性这些分配。首先,我们
导入:
…代码::python
>;>import dit
以下是我们如何在
``dit``中表示硬币。
…代码::python
>;>d=dit.分布(['h','t','e',[.4,.4,.2])
>;>print(d)
类:分布
所有rvs的字母:('e','h','t')
基:线性
结果类:str
结果长度:1
rv名称:无
x p(x)
e 0.2
h0.4
t0.4
代码::python
>;>d['h']
0.4
>;>d.事件概率(['h','t'])
0.8
代码::python
>;>dit.shannon.entropy(d)
1.5219280948873621
>;>dit.other.extropy(d)
1.1419011889093373
代码::python
>;>;导入DIT。示例"dists
>;>;d=DIT。示例"dists.xor"(
>;>);d.设置RV U名称(['x','y','z'])
>;>;打印(d)
类:分发
字母:('0',,'1')对于所有rvs
基:线性
结果类别:str
结果长度:3
rv名称:('x','y','z')
000 0.25
011 0.25
101 0.25
110 0.25
`` i[y:z]``,和
``i[x,y:z]``.
…代码::python
>;>;dit.shannon.相互信息(d,['x',['z'])
0.0
>;>;dit.shannon.相互信息(d,['y',['z'])
0.0
>;>;dit.shannon.相互信息(d,['x','y'],['z'])
1.0
代码::python
>;>d2=d.marginal(['x','z'])
>;>print(d2.to_string(show_mask=true,exact=true))
类:分布
所有rvs的字母表:('0','1')
基:线性
结果类:str
结果长度:2(掩码:3)
rv名称:('x','z')
x p(x)
0*01/4
0*11/4
1*01/4
1*11/4
代码::python
>;>d2.设置基(3.5)
>;>d2.pmf
数组([-1.10658951,-1.10658951,-1.10658951,-1.10658951,-1.10658951])
从该分布中随机抽取5个样本。
…代码::python
>;>dit.math.prng.seed(1)
>;>d2.rand(5)
['01','10','00','01','00']
contributions&help
----
或者,更好的是,打开一个拉取请求。理想情况下,所有的代码都应该被测试和记录,但是请不要让这成为一个阻碍贡献的障碍。我们将与您合作,确保所有拉取请求都处于可共享状态。
如果您想联系任何事情,您可以通过我们的'slack channel<;https://dit python.slack.com/>;``uu.
……徽章:
…|构建图像::https://travis-ci.org/dit/dit.png?branch=master
:目标:https://travis ci.org/dit/dit
:alt:持续集成状态
…| Build_u Windows图像::https://ci.appveyor.com/api/projects/status/idb5hc5gm59whf8m?svg=true
:目标:https://ci.appveyor.com/project/autoselectic/dit
:alt:连续集成状态(Windows)
…| codecov image::https://codecov.io/gh/dit/dit/branch/master/graph/badge.svg
:目标:https://codecov.io/gh/dit/dit
:alt:测试覆盖率状态
。|工作服图片::https://coveralls.io/repos/dit/dit/badge.svg?branch=master
:目标:https://coveralls.io/r/dit/dit?branch=master
:alt:测试覆盖状态
…|文档图片:https://readthedocs.org/projects/dit/badge/?version=latest
:目标:http://dit.readthedocs.org/en/latest/?徽章=最新
:alt:文档状态
…|健康图像::https://landscape.io/github/dit/dit/master/landscape.svg?style=flat
:目标:https://landscape.io/github/dit/dit/master
:alt:code health
。| deps image::https://requires.io/github/dit/dit/requirements.svg?branch=master
:目标:https://requires.io/github/dit/dit/requirements/?branch=master
:alt:需求状态
…| zenodo图像::https://zenodo.org/badge/13201610.svg
:目标:https://zenodo.org/badge/latestdoi/13201610
:alt:doi
……| gitter图像::https://badges.gitter.im/join%20chat.svg
:目标:https://gitter.im/dit/dit?utm_source=badge&utm_medium=badge
:alt:加入聊天
…| sayThanks图像::https://img.shields.io/badge/sayThanks.io-%e2%98%bc-1aedb.svg
:目标:https://sayThanks.io/to/autolectic
:alt:说谢谢!
…| depsy image::http://depsy.org/api/package/pypi/dit/badge.svg
:target:http://depsy.org/package/python/dit
:alt:research software impact
|华夫饼图片:https://badge.waffle.io/dit/dit.png?label=ready&title=ready
:目标:https://waffle.io/dit/dit?utm_source=badge
:alt:stories in ready
。| slack图像::https://img.shields.io/badge/slack dit--python lightgrey.svg
:目标:https://dit python.slack.com/
:alt:dit chat
| joss图像::http://joss.theoj.org/papers/10.21105/joss.00738/status.svg
:目标:https://doi.org/10.21105/joss.00738
:alt:joss status
|活页夹图像::https://mybinder.org/badge.svg
:目标:https://mybinder.org/v2/gh/dit/dit/master?filepath=示例
:alt:run`dit`live!
/>
导论对概率论和统计学来说,量化任意随机变量之间的依赖性
,使其在系统和尺度上具有一致性和可比性。信息论最初是为了量化信息在任意信道中传输的速度和可靠性。现代数据驱动科学的需求一直在协调这些数量和方法,并将其扩展到未知的多变量环境中,在这些环境中,解释和最佳实践是未知的。例如,至少有四种合理的相互信息的多元推广,它们都没有继承标准二元情形的所有解释。最好使用的是上下文相关的。`` dit``
实现了大量的多元信息度量,以使信息
实践者能够研究这些不同度量在各种上下文中的行为和交互。我们希望在一个地方实现所有这些度量和技术,将允许开发健壮的技术来自动量化系统中的依赖项,并具体解释这些依赖项意思是。
日志{开源软件日志},
卷{3},
号{25},
页{738},
年{2018},
doi={https://doi.org/10.21105/joss.00738}
}
basic信息
---------
文档
********
>下载
*****
|
==========================================================>===========================================================================================================================================`contextlib2<;https://contextlib2.readthedocs.io>;`
*`DebtCollector<;https://docs.openstack.org/DebtCollector/>;`
*`networkx<;https://networkx.github.io/>;`
*`numpy<;http://www.numpy.org/>;`|
*`prettytable<;https://code.google.com/archive/p/prettytable/>;`
*`scipy<;https://www.scipy.org/>;`
*`six<;http://pythonhosted.org/six/>;`|
+—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————分布的随机抽样
*matplotlib,python threental:绘制各种信息论展开式
*numdifftools:优化期间梯度和黑森的数值计算
*pint:将单位添加到信息值中
*scikit learn:熵/互信息估计期间更快的近邻查找从示例
安装
**
最简单的安装方法是:
…代码块::bash
``编辑``目录,然后安装包:
…代码块::bash
git克隆https://github.com/dit/dit.git
cd dit
pip安装。
…注意:
windows当前不支持cython扩展。请使用`--nocython``选项安装
。
代码块::shell
$git clone https://github.com/dit/dit.git
$cd dit
$pip install-r requirements\u testing.txt
$py.test
code and bug tracker
***********
实现的度量值
---------
``dit``实现以下信息度量值。其中大多数是在多元条件的一般性中实现的,这些一般性要么存在于文献中,要么相对明显,例如,尽管文献中没有。多变量条件精确公共信息在这里实现。
+---------------------------+---------------------------+---------------------------+---------------------------+
熵互信息|分歧
*香农熵*协信息*变分距离
|*仁义熵*相互作用信息*库尔贝克-莱布勒散度
*tsallis熵*总相关/相对熵
*必要条件熵|多信息*交叉熵
*剩余熵*双总相关*jensen-shannon散度
独立信息绑定信息|*地球运动距离
信息变化*caekl多元互信息+---------------------------+
+---------------------------++其他测度
|公共信息部分信息分解
*信道容量
*gacs-korner公共信息|*:math:`i{min}`*复杂性配置文件
*wyner公共信息*:math:`i{\wedge}`*连接信息
*精确公共信息*:math:`i{\downarrow}`|*累积剩余熵
*函数公共信息*:数学:`i{proj}`*extropy
*mss公共信息*:数学:`i{broja}`*hypercontractive系数|
+---------------------------+*:数学:`i{ccs}`*信息瓶颈
密钥协议界限*:数学:`i{\pm}`*信息图
||*:math:`i{dep}`*信息修剪
*内部互信息*:math:`i{rav}`*LAUTUM信息
*减少内部互信息||*lmpr复杂性|
*最小内在互信息*信息边际效用
*必要内在互信息*最大关联
*保密能力||*最大熵分布|||*率失真理论|
+--------------------------------+--------------------------------+--------------------------------+
quickstart
-------
dit的基本用法对应于创建发行版,根据需要修改发行版,然后计算属性这些分配。首先,我们
导入:
…代码::python
>;>import dit
以下是我们如何在
``dit``中表示硬币。
…代码::python
>;>d=dit.分布(['h','t','e',[.4,.4,.2])
>;>print(d)
类:分布
所有rvs的字母:('e','h','t')
基:线性
结果类:str
结果长度:1
rv名称:无
x p(x)
e 0.2
h0.4
t0.4
代码::python
>;>d['h']
0.4
>;>d.事件概率(['h','t'])
0.8
代码::python
>;>dit.shannon.entropy(d)
1.5219280948873621
>;>dit.other.extropy(d)
1.1419011889093373
代码::python
>;>;导入DIT。示例"dists
>;>;d=DIT。示例"dists.xor"(
>;>);d.设置RV U名称(['x','y','z'])
>;>;打印(d)
类:分发
字母:('0',,'1')对于所有rvs
基:线性
结果类别:str
结果长度:3
rv名称:('x','y','z')
011 0.25
101 0.25
110 0.25
`` i[y:z]``,和
``i[x,y:z]``.
…代码::python
>;>;dit.shannon.相互信息(d,['x',['z'])
0.0
>;>;dit.shannon.相互信息(d,['y',['z'])
0.0
>;>;dit.shannon.相互信息(d,['x','y'],['z'])
1.0
代码::python
>;>d2=d.marginal(['x','z'])
>;>print(d2.to_string(show_mask=true,exact=true))
类:分布
所有rvs的字母表:('0','1')
基:线性
结果类:str
结果长度:2(掩码:3)
rv名称:('x','z')
x p(x)
0*01/4
0*11/4
1*01/4
1*11/4
代码::python
>;>d2.设置基(3.5)
>;>d2.pmf
数组([-1.10658951,-1.10658951,-1.10658951,-1.10658951,-1.10658951])
从该分布中随机抽取5个样本。
…代码::python
>;>dit.math.prng.seed(1)
>;>d2.rand(5)
['01','10','00','01','00']
contributions&help
----
或者,更好的是,打开一个拉取请求。理想情况下,所有的代码都应该被测试和记录,但是请不要让这成为一个阻碍贡献的障碍。我们将与您合作,确保所有拉取请求都处于可共享状态。
如果您想联系任何事情,您可以通过我们的'slack channel<;https://dit python.slack.com/>;``uu.
……徽章:
…|构建图像::https://travis-ci.org/dit/dit.png?branch=master
:目标:https://travis ci.org/dit/dit
:alt:持续集成状态
…| Build_u Windows图像::https://ci.appveyor.com/api/projects/status/idb5hc5gm59whf8m?svg=true
:目标:https://ci.appveyor.com/project/autoselectic/dit
:alt:连续集成状态(Windows)
…| codecov image::https://codecov.io/gh/dit/dit/branch/master/graph/badge.svg
:目标:https://codecov.io/gh/dit/dit
:alt:测试覆盖率状态
。|工作服图片::https://coveralls.io/repos/dit/dit/badge.svg?branch=master
:目标:https://coveralls.io/r/dit/dit?branch=master
:alt:测试覆盖状态
…|文档图片:https://readthedocs.org/projects/dit/badge/?version=latest
:目标:http://dit.readthedocs.org/en/latest/?徽章=最新
:alt:文档状态
…|健康图像::https://landscape.io/github/dit/dit/master/landscape.svg?style=flat
:目标:https://landscape.io/github/dit/dit/master
:alt:code health
。| deps image::https://requires.io/github/dit/dit/requirements.svg?branch=master
:目标:https://requires.io/github/dit/dit/requirements/?branch=master
:alt:需求状态
…| zenodo图像::https://zenodo.org/badge/13201610.svg
:目标:https://zenodo.org/badge/latestdoi/13201610
:alt:doi
……| gitter图像::https://badges.gitter.im/join%20chat.svg
:目标:https://gitter.im/dit/dit?utm_source=badge&utm_medium=badge
:alt:加入聊天
…| sayThanks图像::https://img.shields.io/badge/sayThanks.io-%e2%98%bc-1aedb.svg
:目标:https://sayThanks.io/to/autolectic
:alt:说谢谢!
…| depsy image::http://depsy.org/api/package/pypi/dit/badge.svg
:target:http://depsy.org/package/python/dit
:alt:research software impact
|华夫饼图片:https://badge.waffle.io/dit/dit.png?label=ready&title=ready
:目标:https://waffle.io/dit/dit?utm_source=badge
:alt:stories in ready
。| slack图像::https://img.shields.io/badge/slack dit--python lightgrey.svg
:目标:https://dit python.slack.com/
:alt:dit chat
| joss图像::http://joss.theoj.org/papers/10.21105/joss.00738/status.svg
:目标:https://doi.org/10.21105/joss.00738
:alt:joss status
|活页夹图像::https://mybinder.org/badge.svg
:目标:https://mybinder.org/v2/gh/dit/dit/master?filepath=示例
:alt:run`dit`live!