Skip to content
Multiscale Graph Correlation (and other independence and K-sample tests) in Python
Jupyter Notebook Python Other
Branch: master
Clone or download
Latest commit 5ecdd7a Nov 14, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE Old feature request template May 30, 2019
demos Add changes to render documentation correctly Aug 18, 2019
docs add link to netlify for hosting agreement Oct 4, 2019
hooks Add DockerHub build and env hooks Dec 9, 2018
mgcpy fix mgc input error Nov 14, 2019
.coveragerc Omit power curve files when unit testing Mar 24, 2019
.gitignore Add changes to render documentation correctly Aug 18, 2019
.pypirc Add pypirc for pushing to PyPi Oct 22, 2018
.travis.yml Print to console to avoid stalled build on TravisCI Nov 16, 2018 Update mgcpy to 0.4.0 Aug 18, 2019 Fix links after move from NeuroDataDesign to neurodata org Jan 12, 2019
Dockerfile Fix links after move from NeuroDataDesign to neurodata org Jan 12, 2019
LICENSE Add home page to docs and install instr and licencse Feb 7, 2019 Fix to be able to build from source when wheel is not found … Jan 17, 2019
MGCPY.png Add mgcpy flow diagram to readme Sep 28, 2018 Add MGCX p_value_block method to abstract class Aug 16, 2019 Move git-hooks into hooks Dec 9, 2018
netlify.toml Update netlify.toml Aug 19, 2019
power_curves_dimensions.png updated power curves in readme Dec 14, 2018
requirements.txt Update requirements to build mgcpy Aug 16, 2019
runtime.txt Add build docs script Feb 7, 2019
setup.cfg change dcorr to merge with dev Dec 1, 2018 Update mgcpy to 0.4.0 Aug 18, 2019

The R version is available on CRAN and The MATLAB version is available at


Coverage Status Build Status PyPI PyPI - Downloads DockerHub DOI Documentation Status License PEP8 Code Climate

mgcpy is a Python package containing tools for independence testing using multiscale graph correlation and other statistical tests, that is capable of dealing with high dimensional and multivariate data.


mgcpy aims to be a comprehensive independence testing package including commonly used independence tests and additional functionality such as two sample independence testing and a novel random forest-based independence test. These tests are not only included to benchmark MGC but to have a convenient location for users if they would prefer to utilize those tests instead. The package utilizes a simple class structure to enhance usability while also allowing easy extension of the package for developers. The package can be installed on all major platforms (e.g. BSD, GNU/Linux, OS X, Windows)from Python Package Index (PyPI) and GitHub.


The official documentation with usage is at: ReadTheDocs:

System Requirements

Hardware requirements

mgcpy package requires only a standard computer with enough RAM to support the in-memory operations.

Software requirements

OS Requirements

This package is supported for macOS and Linux. The package has been tested on the following systems:

  • macOS: Mojave (10.14.1)
  • Linux: Ubuntu 16.04

Python Dependencies

mgcpy mainly depends on the Python scientific stack.


Installation Guide:

Install from PyPi

pip3 install mgcpy

Install from Github

git clone
cd mgcpy
python3 install
  • sudo, if required
  • python3 build_ext --inplace # for cython, if you want to test in-place, first execute this

Setting up the development environment:

  • To build image and run from scratch:

    • Install docker
    • Build the docker image, docker build -t mgcpy:latest .
      • This takes 10-15 mins to build
    • Launch the container to go into mgcpy's dev env, docker run -it --rm --name mgcpy-env mgcpy:latest
  • Pull image from Dockerhub and run:

    • docker pull tpsatish95/mgcpy:latest or docker pull tpsatish95/mgcpy:development
    • docker run -it --rm -p 8888:8888 --name mgcpy-env tpsatish95/mgcpy:latest or docker run -it --rm -p 8888:8888 --name mgcpy-env tpsatish95/mgcpy:development
  • To run demo notebooks (from within Docker):

    • cd demos
    • jupyter notebook --ip --no-browser --allow-root
    • Then copy the url it generates, it looks something like this: http://(0de284ecf0cd or
    • Edit this: (0de284ecf0cd or to:, in the above link and open it in your browser
    • Then open mgc.ipynb
  • To mount/load local files into docker container:

    • Do docker run -it --rm -v <local_dir_path>:/root/workspace/ -p 8888:8888 --name mgcpy-env tpsatish95/mgcpy:latest, replace <local_dir_path> with your local dir path.
    • Do cd ../workspace when you are inside the container to view the mounted files. The mgcpy package code will be in /root/code directory.

MGC Algorithm's Flow


Power Curves


This project is covered under the Apache 2.0 License.

You can’t perform that action at this time.