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.
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 both conda
and pip
(Recommended)¶
conda create -n flinty python==3.7.10
conda activate flinty
(Optional) Install dependencies / required packages.
conda install numpy==1.21.1
conda install numba==0.53.1
conda install scipy==1.7.1
conda install gmpy2=2.0.8
Install flintyPy using pip.
pip install flintypy
Run Steps 1,2 and 4. If Step 4 fails, go back to Step 3 and proceed with Step 4.
Using only pip
(Native Python Users with Homebrew)¶
Install virtualenv if you don’t already use it.
brew install virtualenv
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
Activate the virtual environment
source flinty/bin/activate
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.