高维假设检验的双属性。
diproperm的Python项目详细描述
双组分
作者:Iain Carmichael
其他文档、示例和代码修订即将发布。 如有疑问、问题或功能要求,请联系iain: iain@unc.edu。
概述
这个包实现了高维的方向投影置换。
假设检验。有关详细信息,请参见Wei等人,2016(paper link
,arxiv link
)。diproperm“严格评估二元线性分类器是否检测到两个高维分布之间的统计显著差异。”
Wei,S.,Lee,C.,Wichers,L.,&Marron,J.S.(2016年)。高维假设检验的方向投影置换。计算与图形统计杂志,25(2),549-569。
安装
diproperm包可以通过pip或github安装。这个包目前只在Python3.6中测试。
::
pip install diproperm
::
git clone https://github.com/idc9/diproperm.git
python setup.py install
示例
。代码::python
from sklearn.datasets import make_blobs
import numpy as np
import matplotlib.pyplot as plt
# %matplotlib inline
from diproperm.DiProPerm import DiProPerm
# toy binary class dataset (two isotropic Gaussians)
X, y = make_blobs(n_samples=100, n_features=2, centers=2, cluster_std=2)
# DiProPerm with mean difference classifier, mean difference summary
# statistic, and 1000 permutation samples.
dpp = DiProPerm(B=1000, stat='md', clf='md')
dpp.fit(X, y)
dpp.test_stats_['md']
。代码::python
{'Z': 11.704865481794599,
'cutoff_val': 1.2678333596648679,
'obs': 4.542253375623943,
'pval': 0.0,
'rejected': True}
。代码::python
dpp.hist('md')
。图片::doc/figures/dpp_hist.png
有关更多示例代码,请参见these example notebooks
。
帮助和支持
其他文档、示例和代码修订即将发布。 如有疑问、问题或功能要求,请联系iain: iain@unc.edu。
文件 ^^^^^^^^^^^^^
源代码位于github上:https://github.com/idc9/diproperm
测试 ^^^^^^^
测试使用nose
完成。
贡献 ^^^^^^^^^^^^
我们欢迎有人作出贡献,使这一一揽子计划更加强大:数据示例, 错误修复、拼写错误、新功能等。
。_伊恩·卡迈克尔:https://idc9.github.io/ ……_纸张链接:https://www.tandfonline.com/doi/abs/10.1080/10618600.2015.1027773 ……α-ARXIV链路:^ {A6} ……_这些笔记本示例:https://github.com/idc9/diproperm/tree/master/doc