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

Add conditional_bdm to compute BDM(x|y) #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nodtem66
Copy link

  • add conditional_bdm(X,Y) and test_conditional_bdm based on
    supplementary from Hernández-Orozco S, Zenil H, (2021)
  • add compute_f_of_intersect used in Coarse Conditional BDM
    to compute f(n_xj,n_yj)
  • add pytest mark for slow in tox.ini

- add `conditional_bdm(X,Y)` and `test_conditional_bdm` based on
  supplementary from [Hernández-Orozco S, Zenil H, (2021)](doi:10.3389/frai.2020.567356)
- add compute_f_of_intersect used in Coarse Conditional BDM
  to compute f(n_xj, n_yj)
- add pytest mark for slow in `tox.ini`
@codecov
Copy link

codecov bot commented Apr 19, 2021

Codecov Report

Merging #16 (71461aa) into master (4bedea1) will decrease coverage by 1.86%.
The diff coverage is 89.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
- Coverage   92.93%   91.07%   -1.87%     
==========================================
  Files          16       16              
  Lines         863      896      +33     
==========================================
+ Hits          802      816      +14     
- Misses         61       80      +19     
Impacted Files Coverage Δ
pybdm/options.py 40.00% <0.00%> (ø)
pybdm/utils.py 91.30% <0.00%> (-2.18%) ⬇️
pybdm/bdm.py 94.00% <94.11%> (-0.19%) ⬇️
pybdm/algorithms.py 89.25% <100.00%> (-0.83%) ⬇️
tests/conftest.py 70.96% <100.00%> (+2.00%) ⬆️
tests/test_bdm.py 100.00% <100.00%> (ø)
tests/test_partitions.py 100.00% <100.00%> (ø)
tests/test_perturbation.py 100.00% <100.00%> (ø)
pybdm/encoding.py 72.00% <0.00%> (-20.00%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4bedea1...71461aa. Read the comment docs.

@sztal
Copy link
Owner

sztal commented Apr 19, 2021

Hi @nodtem66 and thanks for this contribution! I will merge it in the upcoming new release (hopefully around June/July this year). In the meantime I have an important question.

I see that in some of the tests you added you use PartitionCorrelated. Is this necessary, that is, is correlated partition somehow instrumental for this new method you implemented (I have not yet read the paper)? I am asking because I plan to remove or at least deprecate the correlated partition from the next release as it is not really feasible to define normalized BDM properly in this case.

@nodtem66
Copy link
Author

Thanks, @sztal. I look forward to seeing the next upcoming release.

For your question, I used the PartitionCorrelated in testing because it looks similar to the result from supplementary. The author used StringPartition which is like the correlated partition, as shown in the following figure from the Wolfram notebook: "StringConditionalExperimentsV6.nb". The two test cases in test_bdm.py actually came from this script.
image

So, I suggest either mark it deprecated or throw the exception when using with normalized BDM.

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.

2 participants