Skip to content
This repository has been archived by the owner on Oct 29, 2020. It is now read-only.

Commit

Permalink
Merge 7a09f92 into b5c75c7
Browse files Browse the repository at this point in the history
  • Loading branch information
tpsatish95 committed Dec 13, 2018
2 parents b5c75c7 + 7a09f92 commit f53ff37
Show file tree
Hide file tree
Showing 11 changed files with 1,566 additions and 136 deletions.
1,388 changes: 1,272 additions & 116 deletions demos/mgc.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/source/conf.py
Expand Up @@ -26,7 +26,7 @@
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = 'v0.0.5'
release = 'v0.1.0'


# -- General configuration ---------------------------------------------------
Expand Down
268 changes: 268 additions & 0 deletions mgcpy/benchmarks/mgc_vs_fast_mgc.ipynb

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions mgcpy/benchmarks/power.py
@@ -1,9 +1,10 @@
import numpy as np
import math
from mgcpy.independence_tests.dcorr import DCorr
import scipy.io
import os

import numpy as np
import scipy.io
from mgcpy.independence_tests.dcorr import DCorr


def power(independence_test, sample_generator, num_samples=100, num_dimensions=1, noise=0.0, repeats=1000, alpha=.05, simulation_type=''):
'''
Expand Down
16 changes: 10 additions & 6 deletions mgcpy/benchmarks/unit_tests/power_test.py
@@ -1,12 +1,16 @@
import pytest
import pickle

import h5py
import numpy as np
from scipy.spatial.distance import pdist, squareform
from mgcpy.independence_tests.dcorr import DCorr
from mgcpy.benchmarks.simulations import w_sim, ubern_sim, sin_sim, multi_noise_sim, multi_indep_sim, circle_sim, square_sim, joint_sim
import pytest
from mgcpy.benchmarks.power import power, power_given_data
from mgcpy.benchmarks.simulations import (circle_sim, joint_sim,
multi_indep_sim, multi_noise_sim,
sin_sim, square_sim, ubern_sim,
w_sim)
from mgcpy.independence_tests.dcorr import DCorr
from mgcpy.independence_tests.rv_corr import RVCorr
import pickle
import h5py
from scipy.spatial.distance import pdist, squareform


def test_power():
Expand Down
3 changes: 2 additions & 1 deletion mgcpy/independence_tests/dcorr.py
@@ -1,7 +1,8 @@
import numpy as np
from mgcpy.independence_tests.abstract_class import IndependenceTest
from mgcpy.independence_tests.mgc.distance_transform import \
transform_distance_matrix
from scipy.stats import t
from mgcpy.independence_tests.mgc.distance_transform import transform_distance_matrix


class DCorr(IndependenceTest):
Expand Down
2 changes: 1 addition & 1 deletion mgcpy/independence_tests/mdmr/__init__.py
@@ -1 +1 @@
from .mdmr import MDMR
from .mdmr import MDMR
4 changes: 2 additions & 2 deletions mgcpy/independence_tests/mgc/mgc.py
Expand Up @@ -164,8 +164,8 @@ def _fast_mgc_test_statistic(self, matrix_X, matrix_Y, sub_samples=100, null_onl
test_statistic_sub_sampling = np.zeros(num_samples)

# add trivial noise to break any ties
matrix_X += 1e-10 * np.random.uniform(size=matrix_X.shape)
matrix_Y += 1e-10 * np.random.uniform(size=matrix_Y.shape)
matrix_X = matrix_X + 1e-10 * np.random.uniform(size=matrix_X.shape)
matrix_Y = matrix_Y + 1e-10 * np.random.uniform(size=matrix_Y.shape)

# the local correlations by subsampling
local_correlation_matrix_sub_sampling = np.zeros((sub_samples, sub_samples, num_samples))
Expand Down
2 changes: 1 addition & 1 deletion mgcpy/independence_tests/unit_tests/dcorr/dcorr_test.py
@@ -1,5 +1,5 @@
import pytest
import numpy as np
import pytest
from mgcpy.independence_tests.dcorr import DCorr


Expand Down
@@ -1,9 +1,10 @@
import pytest
import numpy as np
import pytest
from mgcpy.independence_tests.mgc.distance_transform import (center_distance_matrix,
rank_distance_matrix,
transform_distance_matrix)
from scipy.spatial import distance_matrix

from mgcpy.independence_tests.mgc.distance_transform import rank_distance_matrix, center_distance_matrix, transform_distance_matrix


def test_rank_distance_matrix():
a = np.array([[1, 4, 6],
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Expand Up @@ -9,7 +9,6 @@
from sys import platform
import numpy


PACKAGE_NAME = 'mgcpy'
DESCRIPTION = 'A set of tools in Python for multiscale graph correlation and other statistical tests'
with open('README.md', encoding='utf-8') as f:
Expand All @@ -21,7 +20,7 @@

REQUIRED_PACKAGES = ["numpy>=1.14.5", "scipy>=1.1.0", "pytest>=3.8.0", "pycodestyle>=2.3.1", "h5py>=2.7.1",
"Cython==0.29", "flake8>=3.5.0", "pytest-cov>=2.6.0", "coveralls>=1.5.1", "Sphinx>=1.8.2"]
VERSION = '0.0.5'
VERSION = '0.1.0'


def check_python_version():
Expand Down

0 comments on commit f53ff37

Please sign in to comment.