从Fisher分叉(https://github.com/brentp/fishers_exact_test)。用cython 0.29.4重新编译它,使之与python 3.7兼容。

fisher-modified的Python项目详细描述


费希尔精确检验

https://travis-ci.org/brentp/fishers_exact_test.svg?branch=master

简单、快速地实现Fisher’s exact test。。例如,对于下表:

oHaving the propertyNot having the property
Selected125
Not selected292

也许我们感兴趣的是,在选择组和非选择组中是否存在任何性质的差异,然后我们可以做fisher精确检验。

安装

在此文件夹中

easy_install .

来自PYPI

easy_install fisher

或来自Github(欢迎投稿)

git clone git://github.com/brentp/fishers_exact_test.git

用法

fisher.pvalue()接受与2乘2列联表对应的4个值,返回一个具有左尾翼、右尾翼和两个尾翼p值属性的对象

>>> from fisher import pvalue
>>> mat = [[12, 5], [29, 2]]
>>> p = pvalue(12, 5, 29, 2)
>>> p.left_tail, p.right_tail, p.two_tail  # doctest: +NORMALIZE_WHITESPACE, +ELLIPSIS
(0.04455473783507..., 0.994525206021..., 0.0802685520741...)

基准

一个简单的基准,调用fisher精确测试1000次(inscripts/rfisher.py):

calling python fisher...
iterations/sec: 3000.62526381
calling rpy fisher...
iterations/sec: 289.225902364
calling R directly...
iterations/sec: 244.36542276

所以cython fisher的速度是rpy或r版本的10倍。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何实现出站http响应和后续出站http请求之间的特定间隔   java QueryDSL查找在一天中的某个时间发生的多天事件   java我可以使用ApachePivot而不是Swing吗?   java中的安卓 studio调用方法,没有对象或类名   包含GUI类型实例的java停止EDT   具有复合主键的JavaSpring数据rest   JavaJScrollPane不会在JPanel上滚动   Java如何通过值初始化方法内部的HashMap   csv Java二进制文件格式并没有大大减小文件大小   java LibGDX Box2D防止对象在跳跃后减速   java Android:如何停止所有媒体播放器   主要是字符串之间有什么区别。。。Java中的args和String[]args?   java如何重用jframe而不使其成为新的?   java为什么我的计划作业不能并行执行   java将Osgi项目中的WebSocket与Atmosphere集成