GithubHelp home page GithubHelp logo

diproperm's Introduction

DiProPerm

author: Iain Carmichael

Additional documentation, examples and code revisions are coming soon. For questions, issues or feature requests please reach out to Iain: [email protected].

Overview

This package implements Direction-Projection-Permutation for High Dimensional Hypothesis Tests (DiPoPerm). For details see Wei et al, 2016 (paper link, arxiv link). DiProPerm "rigorously assesses whether a binary linear classifier is detecting statistically significant differences between two high-dimensional distributions."

Wei, S., Lee, C., Wichers, L., & Marron, J. S. (2016). Direction-projection-permutation for high-dimensional hypothesis tests. Journal of Computational and Graphical Statistics, 25(2), 549-569.

Installation

The diproperm package can be installed via pip or github. This package is currently only tested in python 3.6.

pip install diproperm
git clone https://github.com/idc9/diproperm.git
python setup.py install

Example

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, separation_stats=['md', 't', 'auc'], clf='md')
dpp.fit(X, y)

dpp.test_stats_['md']
{'Z': 11.704865481794599,
 'cutoff_val': 1.2678333596648679,
 'obs': 4.542253375623943,
 'pval': 0.0,
 'rejected': True}
plt.figure(figsize=[12, 5])
# show histogram of separation statistics
plt.subplot(1, 2, 1)
dpp.plot_perm_sep_stats(stat='md')

# the observed scores
plt.subplot(1, 2, 2)
dpp.plot_observed_scores()

doc/figures/dpp_plots.png

For more example code see these example notebooks.

Help and Support

Additional documentation, examples and code revisions are coming soon. For questions, issues or feature requests please reach out to Iain: [email protected].

Documentation

The source code is located on github: https://github.com/idc9/diproperm

Testing

Testing is done using nose.

Contributing

We welcome contributions to make this a stronger package: data examples, bug fixes, spelling errors, new features, etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.