flintyPy

This is the homepage of flintyPy, the Python version of the software flinty (Flexible and Interpretable Non-parametric Tests of Exchangeability). The R version is available here.

What does this package offer?

flintyPy provides exact tests of exchangeability in multivariate datasets.

  • It is non-parametric (i.e., makes no distributional assumptions of the features), which makes it suitable for settings where the user might prefer not to make distributional assumptions about their data.

  • It is flexible, meaning that the practitioner can specify feature dependencies based on their knowledge of the problem, or can simply provide summary statistics in the form of pairwise distance data. See Examples for details.

  • It is scalable, so the user does not have to worry about the sample size \(N\) or the number of features \(P\) of the data.

  • It is robust, meaning that it controls for false positive rate (FPR) and remains powerful in realistic settings including uneven representation of subpopulations, sparsity of discriminative features, and small sample sizes.

Here is a schema of how flintyPy works.

standalone_6.jpg

How to install?

flintyPy requires Python >= 3.7.10, and for now we recommend the following installation procedures for native Python and for Anaconda users.

Using only pip (Native Python Users with Homebrew)

  1. Install virtualenv if you don’t already use it.

brew install virtualenv
  1. Create a new virtual environment under the working directory.

python3 -m virtualenv --python [PATH-TO-PYTHON>=3.7.10] [ENVIRONMENT-NAME]
# Example: python3 -m virtualenv --python /usr/local/bin/python3.9 flinty
  1. Activate the virtual environment

source flinty/bin/activate
  1. Install flintyPy using pip.

pip install flintypy

Note that if Step 4 fails, a practical workaround solution is to pip install numpy (==1.21.1), numba (==0.53.1), scipy (==1.7.1) and gmpy2 (=2.0.8) right after Step 3.

API reference

Our Module Documentation contains detailed descriptions of the main and auxiliary functions.