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

Support ContinuousFactor in likelihood weighted sampling #925

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

linzhp
Copy link
Contributor

@linzhp linzhp commented Oct 27, 2017

@ankurankan I added continuous factor support in likelihood weighted sampling by encapsulating the sampling details in the corresponding factor classes. The same approach can be easily extended into other sampling methods.

@codecov
Copy link

codecov bot commented Oct 31, 2017

Codecov Report

Merging #925 into dev will decrease coverage by 0.08%.
The diff coverage is 85.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #925      +/-   ##
==========================================
- Coverage   94.74%   94.66%   -0.09%     
==========================================
  Files         114      114              
  Lines       11161    11219      +58     
==========================================
+ Hits        10575    10620      +45     
- Misses        586      599      +13
Impacted Files Coverage Δ
pgmpy/tests/test_sampling/test_Sampling.py 100% <100%> (ø) ⬆️
...py/tests/test_factors/test_discrete/test_Factor.py 99.81% <100%> (ø) ⬆️
pgmpy/factors/discrete/DiscreteFactor.py 98.3% <100%> (+0.02%) ⬆️
pgmpy/factors/continuous/ContinuousFactor.py 85.33% <50%> (-0.97%) ⬇️
pgmpy/factors/distributions/CustomDistribution.py 94.82% <50%> (-0.79%) ⬇️
pgmpy/sampling/Sampling.py 96.68% <72.22%> (-3.32%) ⬇️
pgmpy/factors/discrete/CPD.py 81.75% <94.44%> (+1.75%) ⬆️
pgmpy/inference/ExactInference.py 94.81% <0%> (-1.15%) ⬇️
pgmpy/readwrite/UAI.py 86.4% <0%> (-0.85%) ⬇️
pgmpy/tests/test_readwrite/test_ProbModelXML.py 94.95% <0%> (ø) ⬆️
... and 5 more

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 0f62927...9806ac7. Read the comment docs.

@ankurankan
Copy link
Member

@linzhp Thanks a lot for the PR. I am waiting on #918 before I merge this.

khalibartan
khalibartan previously approved these changes Nov 6, 2017
Copy link
Member

@khalibartan khalibartan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@@ -96,6 +96,9 @@ def variables(self):
def variables(self, value):
self._variables = value

def sample(self, size, evidence):
raise NotImplementedError('Coming soon...')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message suggestion: Work in progress, maybe you can help us out :D

@linzhp
Copy link
Contributor Author

linzhp commented Nov 6, 2017

OK. Let me know when you are ready, so I can rebase

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.

None yet

3 participants