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

Fixed initializing ContinuousFactor to a GaussianDistribution #991

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

Conversation

JustinTervala
Copy link
Contributor

Fixes

This fix allows a ContinuousFactor to be directly constructed to use a GaussianDistribution as identified in issue 990.
#990

The tests on my branch aren't passing, but the test written for this PR passes

def test_class_init_gaussian(self):
mean = np.array([1, -3, 4])
cov = np.array([[4, 2, -2], [2, 5, -5], [-2, -5, 8]])
phi1 = ContinuousFactor(['x1', 'x2'], 'gaussian', mean=mean, covariance=cov)
Copy link
Member

Choose a reason for hiding this comment

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

@JustinTervala This distribution is a 3 variable distribution. Please add one more variable. Tests should pass then.

@khalibartan
Copy link
Member

khalibartan commented Mar 26, 2018

@JustinTervala Please rebase your branch to latest dev. You can read about rebase here. Also, please squash the commits into a single commit.

@codecov
Copy link

codecov bot commented Mar 30, 2018

Codecov Report

Merging #991 into dev will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #991      +/-   ##
==========================================
+ Coverage   94.76%   94.79%   +0.03%     
==========================================
  Files         116      116              
  Lines       11314    11322       +8     
==========================================
+ Hits        10722    10733      +11     
+ Misses        592      589       -3
Impacted Files Coverage Δ
pgmpy/factors/continuous/ContinuousFactor.py 89.04% <ø> (+2.73%) ⬆️
...t_factors/test_continuous/test_ContinuousFactor.py 99.01% <100%> (+0.02%) ⬆️
pgmpy/models/BayesianModel.py 96.03% <0%> (+0.39%) ⬆️

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 0b382c6...1819e5f. Read the comment docs.

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.

@JustinTervala Can you please make changes to docs. In Line 24 pdf can be of type function or a str not just function. Also, can you add an example on how to create GaussianDistribution using string.

@ankurankan
Copy link
Member

@JustinTervala Thanks for the PR. Could you please rebase your branch to the latest dev ?

@khalibartan
Copy link
Member

@ankurankan @JustinTervala I believe we should also add an example on how to create GaussianDistribution using string.

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