Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional Correlation Tests #349

Open
wants to merge 152 commits into
base: main
Choose a base branch
from
Open

Conditional Correlation Tests #349

wants to merge 152 commits into from

Conversation

j1c
Copy link
Member

@j1c j1c commented Jan 31, 2023

Reference issue

Closes #332

Type of change

Addition of three correlation based conditional independence tests.

  1. Partial pearson correlation test (univariate only)
  2. Partial distance correlation (Szekely 2014)
  3. Conditional distance correlation (Wang 2015)

Others

  1. Simulations for conditional independence
  2. Power curves for partial dcorr and conditional dcorr
  3. Tests

Additional information

Few functions in tools were changed to accommodate for three input data matrices.

  1. compute_dist
  2. _check_distmat
  3. _perm_stat
  4. perm_test

rflperry and others added 30 commits January 13, 2021 08:56
* perm tree docs

* base docstrings
* sort imports

* fix docs error short underline

* add energy source code

* fix tutorials not rendering

* add more detail to compute distance and kernel
* Add .circleci/config.yml

* remove travis config and lower parallel

* use new circleci config file

* fix setup.py init

* add codecov package

* fix circle ci build issues

* remove build from yaml

* remove build

* fix ci build errors

* rerun circle ci

* set docker image for deployment

* parralelize circleci config

* Update config.yml

* fix cache issues

* don't cache test suite

* see if cimg to circleci fixes build

* back to cimg

* fix cache issues

* remove test dependence on build

* change cache among python versions

* maintain order for build

* change cache

* run on lowest environment packages

* use min python versions

* don't test 3.8

* add joblib as a dependency

* add joblib

* set llvm version

* update llvm before numba

* workers default should be 1

* fix python 3.7 failings

* raise base sklearn package

* remove smoke test
* speed up circleci builds

* add module definition

* change name from build

* change required branch

* set workflows

* change parameter names

* name parameter preserved

* name param reserved

* numpy conditional on python version

* forgot equal sign

* fix python version issues

* fix 3.6 dependency issues

* fix requirements.txt

* fix duplicate requirements error

* upgrade pip fix double requirement

* upload code coverage correctly

* add pytest-cov

* change location of coverage reports

* Updated config.yml

* default file

* use coveralls instead

* add codecov orb

* fix coverage not uploading

* Update config.yml

* add proper path for coverage reports

* fix codecov reports

* limit coverage per module
* use xml for coverage reports

* change to project root

* fix name of file

* use terminal command instead of orb

* use codecov orb for faster report merges

* use orb to merge reports faster
* update readme badges

* update readme badges
* sort imports

* fix docs error short underline

* add energy source code

* fix tutorials not rendering

* add more detail to compute distance and kernel

* add tutorials folder with overview

* add folder to gitignore

* add contributing guidelines to github repo

* make docs look nicer

* change reference to use automodule

* add changelog to single file

* remove reference folder

* make clear the package reqs needs to be installed

* simplify autosummary table

* remove old changelog files

* add file with all automodules

* change docs layout

* add gallery and misc docs changes

* change order of sidebar

* make install docs more clear

* update makefile with autogen and more options

* update docs package requirements

* remove github_links file

* remove old tutorial folder

* remove tutorials and gallery folders from docs

* add discriminability

* add statistic to the docs

* fix dcorr and hsic incorrect stats

* add citation page

* add internal links within docs

* use readme in index.rst

* add links for dependencies

* use meth and class

* update doc requirements

* remove docs tutorial page

* update README to rst

* Update setup.py

* fix reference docs formatting

* remove figure from package overview

* add example folder

* add mgc map example

* add independence simulations example

* add feature importance example

* install package pip netlify

* Update netlify.toml

* add recommonmark

* add matplotlib and seaborn

* add tutorials and mmd

* add disco

* update doctest errors

* Update mmd.py

* fix intersphinx mapping

* move gaussian sim to new example

* remove reps warning

* add fast 1D Dcorr

* add helper functions reference

* add manova and hotelling

* fix documentation weird renderings

* remove unused import indep_sims

* add max margin test

* fix doctest assertion errors

* cache numba

* add k-sample tutorial

* move general example to overview py file

* add time-series tutorial

* add time series tutorial

* add time series sims

* fix tutorials

* add v to tag name

* change order of independence test

* add discriminability tutorial

* change name of time series sim file

* [skip ci] clean netlify directory

* [skip ci] rebuild docs

* [skip ci] update netlify runtime version

* change netlify build command to fix intersphinx
* fix overview rendering issue

* increment version

* update changelog

* fix changelog release date

* remove make clean in netlify toml

* README codecov typo
* incorporate changes from other branches to master (#175)

* update changelog rendering

* expose independence tests dictionary

* add same statistic example

* expose time series dict

* add max margin test

* remove warning js button

* add anton kernel fix

* update same statistic

* add performance comparison example

* rename common test file

* add dictionary for k-sample tests

* add docs dependencies to README

* remove perf file rename 1d

* add information about base classes

* improve test coverage

* reformat black

* reformat with upgraded black

* improve coverage

* [skip-ci] add discrim error check

* add question template

* Update CONTRIBUTING.md

* add power

* update misc docs

* add independence power curves

* Type i error checks (#178)

* add benchmarks folder to gitignore

* sum used to prevent deprecation warning

* fix fast 1D dcorr invalid implementation

* add power unit tests

* add base classes to documentation

* fix doctest assertion errors

* rename codecov so yml shows up

* fix pytest assertions

* update version to 0.2.1

* add changelog for new version
* Delete cubic_Hsic.csv

* Delete cubic_KMERF.csv

* Delete cubic_MGC.csv

* Delete cubic_RV.csv

* Delete diamond_CCA.csv

* Delete diamond_Dcorr.csv

* Delete diamond_HHG.csv

* Delete diamond_Hsic.csv

* Delete diamond_KMERF.csv

* Delete diamond_MGC.csv

* Delete diamond_RV.csv

* Delete ellipse_CCA.csv

* Delete ellipse_Dcorr.csv

* Delete ellipse_HHG.csv

* Delete ellipse_Hsic.csv

* Delete ellipse_KMERF.csv

* Delete ellipse_MGC.csv

* Delete ellipse_RV.csv

* Delete w_shaped_CCA.csv

* Delete w_shaped_Dcorr.csv

* Delete w_shaped_HHG.csv

* Delete w_shaped_Hsic.csv

* Delete w_shaped_KMERF.csv

* Delete w_shaped_MGC.csv

* Delete w_shaped_RV.csv

* Delete uncorrelated_bernoulli_CCA.csv

* Delete uncorrelated_bernoulli_Dcorr.csv

* Delete uncorrelated_bernoulli_HHG.csv

* Delete uncorrelated_bernoulli_Hsic.csv

* Delete uncorrelated_bernoulli_KMERF.csv

* Delete uncorrelated_bernoulli_MGC.csv

* Delete uncorrelated_bernoulli_RV.csv

* Delete two_parabolas_CCA.csv

* Delete two_parabolas_Dcorr.csv

* Delete two_parabolas_HHG.csv

* Delete two_parabolas_Hsic.csv

* Delete two_parabolas_KMERF.csv

* Delete two_parabolas_MGC.csv

* Delete two_parabolas_RV.csv

* Delete step_CCA.csv

* Delete step_Dcorr.csv

* Delete step_HHG.csv

* Delete step_Hsic.csv

* Delete step_KMERF.csv

* Delete step_MGC.csv

* Delete step_RV.csv

* Delete exponential_CCA.csv

* Delete exponential_Dcorr.csv

* Delete exponential_HHG.csv

* Delete exponential_Hsic.csv

* Delete exponential_KMERF.csv

* Delete exponential_MGC.csv

* Delete exponential_RV.csv

* Delete square_CCA.csv

* Delete square_Dcorr.csv

* Delete square_HHG.csv

* Delete square_Hsic.csv

* Delete square_KMERF.csv

* Delete square_MGC.csv

* Delete square_RV.csv

* Delete spiral_CCA.csv

* Delete spiral_Dcorr.csv

* Delete spiral_HHG.csv

* Delete spiral_Hsic.csv

* Delete spiral_KMERF.csv

* Delete spiral_MGC.csv

* Delete spiral_RV.csv

* Delete sin_sixteen_pi_CCA.csv

* Delete sin_sixteen_pi_Dcorr.csv

* Delete sin_sixteen_pi_HHG.csv

* Delete sin_sixteen_pi_Hsic.csv

* Delete sin_sixteen_pi_KMERF.csv

* Delete sin_sixteen_pi_MGC.csv

* Delete sin_sixteen_pi_RV.csv

* Delete fourth_root_CCA.csv

* Delete fourth_root_Dcorr.csv

* Delete fourth_root_HHG.csv

* Delete fourth_root_Hsic.csv

* Delete fourth_root_KMERF.csv

* Delete fourth_root_MGC.csv

* Delete fourth_root_RV.csv

* Delete joint_normal_CCA.csv

* Delete joint_normal_Dcorr.csv

* Delete joint_normal_HHG.csv

* Delete joint_normal_Hsic.csv

* Delete joint_normal_KMERF.csv

* Delete joint_normal_MGC.csv

* Delete joint_normal_RV.csv

* Delete sin_four_pi_CCA.csv

* Delete sin_four_pi_Dcorr.csv

* Delete sin_four_pi_HHG.csv

* Delete sin_four_pi_Hsic.csv

* Delete sin_four_pi_KMERF.csv

* Delete sin_four_pi_MGC.csv

* Delete sin_four_pi_RV.csv

* Delete quadratic_CCA.csv

* Delete quadratic_Dcorr.csv

* Delete quadratic_HHG.csv

* Delete quadratic_Hsic.csv

* Delete quadratic_KMERF.csv

* Delete quadratic_MGC.csv

* Delete quadratic_RV.csv

* Delete multiplicative_noise_CCA.csv

* Delete multiplicative_noise_Dcorr.csv

* Delete multiplicative_noise_HHG.csv

* Delete multiplicative_noise_Hsic.csv

* Delete multiplicative_noise_KMERF.csv

* Delete multiplicative_noise_MGC.csv

* Delete multiplicative_noise_RV.csv

* Delete multimodal_independence_CCA.csv

* Delete multimodal_independence_Dcorr.csv

* Delete multimodal_independence_HHG.csv

* Delete multimodal_independence_Hsic.csv

* Delete multimodal_independence_KMERF.csv

* Delete multimodal_independence_MGC.csv

* Delete multimodal_independence_RV.csv

* Delete logarithmic_CCA.csv

* Delete logarithmic_Dcorr.csv

* Delete logarithmic_HHG.csv

* Delete logarithmic_Hsic.csv

* Delete logarithmic_KMERF.csv

* Delete logarithmic_MGC.csv

* Delete logarithmic_RV.csv

* Delete linear_CCA.csv

* Delete linear_Dcorr.csv

* Delete linear_HHG.csv

* Delete linear_Hsic.csv

* Delete linear_KMERF.csv

* Delete linear_MGC.csv

* Delete linear_RV.csv

* Delete circle_CCA.csv

* Delete circle_Dcorr.csv

* Delete circle_HHG.csv

* Delete circle_Hsic.csv

* Delete circle_MGC.csv

* Delete circle_RV.csv

* Delete cubic_CCA.csv

* Delete cubic_Dcorr.csv

* Delete cubic_HHG.csv

* Delete cubic_MGC.csv

* Delete cubic_Hsic.csv

* Delete cubic_RV.csv

* Delete diamond_CCA.csv

* Delete diamond_Dcorr.csv

* Delete diamond_HHG.csv

* Delete diamond_Hsic.csv

* Delete diamond_MGC.csv

* Delete diamond_RV.csv

* Delete ellipse_CCA.csv

* Delete ellipse_Dcorr.csv

* Delete ellipse_HHG.csv

* Delete ellipse_Hsic.csv

* Delete ellipse_MGC.csv

* Delete ellipse_RV.csv

* Delete exponential_CCA.csv

* Delete exponential_Dcorr.csv

* Delete exponential_HHG.csv

* Delete exponential_Hsic.csv

* Delete exponential_MGC.csv

* Delete exponential_RV.csv

* Delete fourth_root_CCA.csv

* Delete fourth_root_Dcorr.csv

* Delete fourth_root_HHG.csv

* Delete fourth_root_Hsic.csv

* Delete fourth_root_MGC.csv

* Delete fourth_root_RV.csv

* Delete joint_normal_CCA.csv

* Delete joint_normal_Dcorr.csv

* Delete joint_normal_HHG.csv

* Delete joint_normal_Hsic.csv

* Delete joint_normal_MGC.csv

* Delete joint_normal_RV.csv

* Delete linear_CCA.csv

* Delete linear_Dcorr.csv

* Delete linear_HHG.csv

* Delete linear_Hsic.csv

* Delete linear_MGC.csv

* Delete linear_RV.csv

* Delete logarithmic_CCA.csv

* Delete logarithmic_Dcorr.csv

* Delete logarithmic_HHG.csv

* Delete logarithmic_Hsic.csv

* Delete logarithmic_MGC.csv

* Delete logarithmic_RV.csv

* Delete w_shaped_CCA.csv

* Delete w_shaped_Dcorr.csv

* Delete w_shaped_HHG.csv

* Delete w_shaped_Hsic.csv

* Delete w_shaped_MGC.csv

* Delete w_shaped_RV.csv

* Delete uncorrelated_bernoulli_CCA.csv

* Delete uncorrelated_bernoulli_Dcorr.csv

* Delete uncorrelated_bernoulli_HHG.csv

* Delete uncorrelated_bernoulli_Hsic.csv

* Delete uncorrelated_bernoulli_MGC.csv

* Delete uncorrelated_bernoulli_RV.csv

* Delete two_parabolas_CCA.csv

* Delete two_parabolas_Dcorr.csv

* Delete two_parabolas_HHG.csv

* Delete two_parabolas_Hsic.csv

* Delete two_parabolas_MGC.csv

* Delete two_parabolas_RV.csv

* Delete step_CCA.csv

* Delete step_Dcorr.csv

* Delete step_HHG.csv

* Delete step_Hsic.csv

* Delete step_MGC.csv

* Delete step_RV.csv

* Delete square_CCA.csv

* Delete square_Dcorr.csv

* Delete square_HHG.csv

* Delete square_Hsic.csv

* Delete square_MGC.csv

* Delete square_RV.csv

* Delete spiral_CCA.csv

* Delete spiral_Dcorr.csv

* Delete spiral_HHG.csv

* Delete spiral_Hsic.csv

* Delete spiral_MGC.csv

* Delete spiral_RV.csv

* Delete multimodal_independence_CCA.csv

* Delete multimodal_independence_Dcorr.csv

* Delete multimodal_independence_HHG.csv

* Delete multimodal_independence_Hsic.csv

* Delete multimodal_independence_MGC.csv

* Delete multimodal_independence_RV.csv

* Delete multiplicative_noise_CCA.csv

* Delete multiplicative_noise_Dcorr.csv

* Delete multiplicative_noise_HHG.csv

* Delete multiplicative_noise_Hsic.csv

* Delete multiplicative_noise_MGC.csv

* Delete multiplicative_noise_RV.csv

* Delete sin_sixteen_pi_CCA.csv

* Delete sin_sixteen_pi_Dcorr.csv

* Delete sin_sixteen_pi_HHG.csv

* Delete sin_sixteen_pi_Hsic.csv

* Delete sin_sixteen_pi_MGC.csv

* Delete sin_sixteen_pi_RV.csv

* Delete sin_four_pi_CCA.csv

* Delete sin_four_pi_Dcorr.csv

* Delete sin_four_pi_HHG.csv

* Delete sin_four_pi_Hsic.csv

* Delete sin_four_pi_MGC.csv

* Delete sin_four_pi_RV.csv

* Delete quadratic_CCA.csv

* Delete quadratic_Dcorr.csv

* Delete quadratic_HHG.csv

* Delete quadratic_Hsic.csv

* Delete quadratic_MGC.csv

* Delete quadratic_RV.csv
* update maxmargin fast dcorr

* add accessibility changes
* make median kernel default for rbf and gaussian

* recache dependencies

* increment cache key
* Update LICENSE

* Switch to MIT license

* Switch to MIT license
* Added typing to output of test methods. Updated requirements.

* Removed inheritance of namedtuple because it doesn't work as expected.

* Removed unnecessary requirements.
* fix same stat formatting issues

* don't numbify max margin Dcorr

* misc doc changes

* backreference api link correctly

* fix custom css

* update accessibility colors

* fix rst spacing

* try removing custom css

* Update conf.py

* change recommonmark to new parser

* explicitly define doc requirements

* bring back recommonmark
* remove master references

* change edit on github to create issue instead

* fix broken links

* fix rst file urls

* fix broken urls

* use documentation github issue template for api sphinx files
* reproducibility to perm test

* remove import

* add random_state as parameter

* remove noseids

* Delete .noseids

* remove comment

* add randomness based on parameter

* add reproducibility to discrim tests

* reproducibility tests for independence

* fix independence tests

* actually fix independence tests

* reproducibility to ksample tests

* add reproducibility to time series tests

* add newline

* reproducibility to time series tests only

* modify examples

Co-authored-by: Haoyin Xu <haoyinxu@gmail.com>
Co-authored-by: Sambit Panda <36676569+sampan501@users.noreply.github.com>
* MAINT update license in setup

* MAINT update license
@codecov
Copy link

codecov bot commented Mar 8, 2023

Codecov Report

Attention: 17 lines in your changes are missing coverage. Please review.

Comparison is base (9e7fc39) 96.71% compared to head (83087b0) 96.80%.
Report is 2 commits behind head on main.

Files Patch % Lines
hyppo/conditional/_utils.py 92.06% 5 Missing ⚠️
hyppo/conditional/cdcorr.py 93.67% 5 Missing ⚠️
hyppo/tools/power.py 77.77% 4 Missing ⚠️
hyppo/conditional/tests/test_utils.py 95.65% 2 Missing ⚠️
hyppo/conditional/pdcorr.py 97.61% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #349      +/-   ##
==========================================
+ Coverage   96.71%   96.80%   +0.09%     
==========================================
  Files          86       96      +10     
  Lines        3891     4504     +613     
==========================================
+ Hits         3763     4360     +597     
- Misses        128      144      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@j1c j1c marked this pull request as ready for review October 17, 2023 01:18
@sampan501
Copy link
Member

@j1c The only thing missing is a few unit tests for some of the error checks. Once those are added, I'll merge

@sampan501 sampan501 changed the base branch from dev to main December 27, 2023 16:46
@sampan501
Copy link
Member

@j1c Let me know when you believe that everything looks good and I'll review

@j1c
Copy link
Member Author

j1c commented Jan 29, 2024

@j1c Let me know when you believe that everything looks good and I'll review

This is good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conditional distance correlation for conditional independence?