快速费希尔精确检验

fisher的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使用ApachePOI将excel文件导入postgreSQL表   java多线程从iText pdf提取文本   winapi Java和SetWindowDisplayAffinity   eclipse juno的java Websphere 6.1插件   java MPAndroidChart:为Y轴提供一些偏移   java中作为参数传递枚举类型的继承   java Gui jframe的工作原理与netbeans不同   使用Bouncy Castle和PDFBox在Java中验证PDF签名   优化缩小Java代码   java无法在安卓中从Firebase取回子数据   返回的java方法?我应该什么时候用?   java错误处理已完成,退出代码为1。与穿过阵列的for循环有关   多线程Java volatile是否阻止缓存或强制执行写缓存?   java Multi-collectItems如何提前终止并返回已收集的项目   java为什么不在服务(请求,响应)中直接调用processRequest(请求,响应)?   java如何从字符串生成int数组?   打印获取用户输入的值并在其他预选文本中显示。JAVA   未显示java DynamicAsper UTF8字符   java Eclipse RCP:不启动应用程序的命令行参数