Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 17 15:29
    codecov[bot] commented #1176
  • Nov 17 15:29
    codecov[bot] commented #1176
  • Nov 17 15:29
    codecov[bot] commented #1176
  • Nov 17 15:16
    codecov[bot] commented #1176
  • Nov 17 15:16
    ankurankan synchronize #1176
  • Nov 17 15:04
    codecov[bot] commented #1176
  • Nov 17 15:04
    ankurankan synchronize #1176
  • Nov 17 15:02

    ankurankan on dev

    Include Structural Equation Mod… (compare)

  • Nov 17 15:02
    ankurankan closed #1187
  • Nov 17 15:02
    codecov[bot] commented #1187
  • Nov 17 15:02
    codecov[bot] commented #1187
  • Nov 17 15:01
    codecov[bot] commented #1187
  • Nov 17 14:46
    ankurankan edited #1187
  • Nov 17 14:46
    ankurankan edited #1187
  • Nov 17 14:46
    ankurankan edited #1187
  • Nov 17 14:46
    ankurankan edited #1187
  • Nov 17 14:46
    ankurankan opened #1187
  • Nov 17 14:37
    codecov[bot] commented #1186
  • Nov 17 14:37
    codecov[bot] commented #1186
  • Nov 17 14:36

    ankurankan on dev

    Updates the docs (compare)

Utkarsh
@khalibartan
@odirar Yes you can you use that. In case if it raises some import error, checkout docs. We have changed directory structure and notebooks example might not have been updated to reflect those.
odirar
@odirar
@khalibartan ahh ok will do, thank you for the insight, much appreciated :)
odirar
@odirar
@khalibartan hey, sorry to bother you again, but i just wanted to ask, is pgmpy (0.1.6) able to compute joint distributions over multiple variable using variable elimination? or is there any other way of doing this atm? (pgmpy/pgmpy#945)
Utkarsh
@khalibartan
@odirar No currently it doesn't.
z2862658714
@z2862658714

Hello there, I'm trying to work out the ProbModelXML file format by generating a file from a working model I created using the method said on the notebook tutorial (https://github.com/pgmpy/pgmpy_notebook/blob/master/notebooks/8.%20Reading%20and%20Writing%20from%20pgmpy%20file%20formats.ipynb)

model_data = get_probmodel_data(valve_model);
writer = ProbModelXMLWriter(model_data=model_data);
print(writer);

and it give me this error

Traceback (most recent call last):
File "/Users/-/Desktop/Valve.py", line 49, in <module>
model_data = get_probmodel_data(valve_model);
File "/Users/-/anaconda3/lib/python3.5/site-packages/pgmpy/readwrite/ProbModelXML.py", line 266, in get_probmodel_data
model_data['probnet']['edges'][str(edge)] = model.edge[edge[0]][edge[1]]
AttributeError: 'BayesianModel' object has no attribute 'edge'

I tried to fix it by modify line 266 in ProbModelXML.py to

model_data['probnet']['edges'][str(edge)] = model.edges[edge[0]][edge[1]]

and now I'm receiving this error:

Traceback (most recent call last):
File "/Users/-/Desktop/Valve.py", line 49, in <module>
model_data = get_probmodel_data(valve_model);
File "/Users/-/anaconda3/lib/python3.5/site-packages/pgmpy/readwrite/ProbModelXML.py", line 266, in get_probmodel_data
model_data['probnet']['edges'][str(edge)] = model.edges[edge[0]][edge[1]]
File "/Users/-/anaconda3/lib/python3.5/site-packages/networkx/classes/reportviews.py", line 930, in getitem
return self._adjdict[u][v]
KeyError: 'n'

It seems like there's an error associated with the indexing (model.edges[edge[0]][edge[1]]), but I'm not sure how to fix it. Would appreciate if anyone could help.

Mariangelly Díaz
@cosmmicdust_twitter
hi all, new to pgmpy. Is there a way I can produce a flow diagram of my variables within the package?
Matthias Lung
@mmmlung
Hi. I am starting to study PGM (1 week into Courseras course by Daphne Koller). I am playing with my first toy model using PGMPY : ) Is it possible to modify state names ? I came around PGMPY util.state_name but did not quite understand how it works. I would be grateful for a hint ; )
Jonathan Mugan
@jmugan
Are there any examples of people using pgmpy for expectation maximization (EM) for Bayesian networks with hidden variables?
ranxiao89
@ranxiao89
Hi. How can I access the values from a table from a VariableElimination query result?
sphinx-jiang
@sphinx-jiang
Hi guys, do any of you met my issue: import pgmpy fail in jupyter notebook, but could run it in python file?
For details, I have logged issue:pgmpy/pgmpy#1024
@khalibartan jupyter notebook is supported, right?
hcl734
@hcl734

@jmugan

Are there any examples of people using pgmpy for expectation maximization (EM) for Bayesian networks with hidden variables?

Have you found anything on this?
I would also be interested.

Rashmeet Nayyar
@Rashmeet09
Hi guys, is there support for gaussian as well discrete nodes while constructing bayesian networks now (hybrid model)?
Rashmeet Nayyar
@Rashmeet09
Or is there a way to specify evidence when using the ContinuousFactor (for creating a continuous random variable node)?
James Matthew Miraflor
@miraflor
Hello pgmpy community! I'm looking forward to contribute modules soon.
Chester
@llsjdkn
hi everynoe, there are some bugs in models-DynamicBayesianNetork.py-get_cpds(). Has it been fixed? Thanks for any help.
karnatapu
@karnatapu
hello
i see lot of fixes made to the orginal code, do anyone know how to pull latest code which has the bug fixes. Git clone gives non-fix solution. any clue
Ankur Ankan
@ankurankan
@karnatapu You can use pip: pip install pgmpy --upgrade. It should update to the latest version.
kbe206
@kbe206
df = pd.DataFrame(data)
est = HillClimbSearch(df, scoring_method=BicScore(df))
best_model = est.estimate()
edges = best_model.edges()
unsupported operand type(s) for +: 'OutEdgeView' and 'list'
Some people have this problem?
Ankur Ankan
@ankurankan
@kbe206 Try downgrading networkx to 1.11
karnatapu
@karnatapu
@ankurankan Thank you for the response. I did the pip update. After I update I did checked the python files and it does not show the fixes. for ex: Bic,Base, K2score doesn't have LRU implementation. Btw, when I do the update, I got the version as latest 0.1.7 (Successfully installed pgmpy-0.1.7). is this the version had all the updates?
Ankur Ankan
@ankurankan
@karnatapu Yes 0.1.7 is the latest. I am not sure about the cache implementation, it should have been there but doesn't seem to be. I will check and get back to you.
Ankur Ankan
@ankurankan
@karnatapu Thanks for pointing out the PR. I had totally forgotten about it. I will check if that can be merged.
Mark McKenzie
@mrkmcknz
Evening everyone. I was wondering what the most logical method is to get a list of value labels for a node. Kind of like what you see in the get_cpds() output.
Mark McKenzie
@mrkmcknz
I was half expecting it to be .variables
Ankur Ankan
@ankurankan
@mrkmcknz I am not sure what you exactly mean by value labels. Could you please elaborate?
Mark McKenzie
@mrkmcknz
+-------------------------------------+-----------+
| project_type(Fast Track Onboarding) | 0.0299222 |
+-------------------------------------+-----------+
| project_type(Innovation)            | 0.0113704 |
+-------------------------------------+-----------+
| project_type(governance)            | 0.0388989 |
+-------------------------------------+-----------+
| project_type(innovation)            | 0.032316  |
+-------------------------------------+-----------+
| project_type(other)                 | 0.831837  |
+-------------------------------------+-----------+
| project_type(performance)           | 0.0359066 |
+-------------------------------------+-----------+
| project_type(productivity)          | 0.0197487 |
+-------------------------------------+-----------+
In this example I want to get Fast Track Onboarding, Innovation...
Ankur Ankan
@ankurankan
@mrkmcknz You can use the .state_names attribute. It should return a dict of state names of all the variables.
Mark McKenzie
@mrkmcknz
Thanks @ankurankan I managed to find it last night. I'm just working on this pgmpy/pgmpy#913 I might create a PR for my implementation at some point when I clean the code up
Mark McKenzie
@mrkmcknz
I see a lot of comments in various places re continuous/discrete hybrid models in the pipelines. I was wondering what progress has been made towards this.
Ankur Ankan
@ankurankan
@mrkmcknz I am currently working on a Data class which will implement different conditional independence testing algorithms (for both continuous and hybrid). And with minor changes in the current structure learning algorithms, they should be able to learn the structure from continuous and hybrid datasets. But I don't think I will have the bandwidth to work on parameter learning or inference on continuous models soon.
5991dream
@5991dream
hello,I want to learn the PGM entry information. Do you have any recommendations?
5991dream
@5991dream
I am a newbie
pengjunli
@pengjunli
Hi guys, I am a starter. I want to use DBN of pgm, but I hava not found documentation on parameter learning, structure learning and inference for DBN. Any demo or documentation about DBN? Thanks for help.
Clemens Harten
@clemensharten_twitter
Hey everyone, I am just getting started with pgmpy, and have a question regarding performance of inference via BeliefPropagation. I have setup a moderate Bayesian Network (about 40 nodes, 80 edges), and want to get the state probabilities for a central node (without providing any evidence). With the recent dev-branch, this operation will take about 4-5 minutes on my developer-machine (i7, 8GB RAM ...) I would have thought it to be faster. Am I hitting any limits here (exponential runtime growths?), or should this indeed be faster, and I am doing something wrong? Any help much appreciated!
Clemens Harten
@clemensharten_twitter
... so, just for the record: BeliefPropagation is implemented as an exact algorithm. For my use case, I need an approximation, and BayesianModelSampling gives me exactly what I need :).
Ankur Ankan
@ankurankan
@clemensharten_twitter Yes, it's slow because it finds the exact solution. VariableElimination should be faster for exact solutions.
Yujian Liu
@yujianll
Hi everyone, I wonder what's the correct way to build a Bayesian Network from an undirected graph (I have a list of undirected edges, and I just want to add directionality to those edges).
Yujian Liu
@yujianll
Does anyone know if there is a function that returns the separating_sets given a specific undirected graph, or how can I do that manually?
jonvaljohn
@jonvaljohn
Hi, just installed pgmpy on the Mac using the latest code from the dev branch. When I run "nosetests -v", one test fails, is that expected?
Ankur Ankan
@ankurankan
@jonvaljohn Not really. Is it TestIVEstimator by any chance?
jonvaljohn
@jonvaljohn

FAIL: test_sampling (pgmpy.tests.test_sampling.test_continuous_sampling.TestNUTSInference)


Traceback (most recent call last):
File "/Users/jonvaljohn/Code/pgmpy/pgmpy/pgmpy/tests/test_sampling/test_continuous_sampling.py", line 208, in test_sampling
np.linalg.norm(sample_covariance - self.test_model.covariance) < 0.4
AssertionError: False is not true


Ran 676 tests in 146.484s

FAILED (SKIP=7, failures=1)

jonvaljohn
@jonvaljohn
@ankurankan, this is the error I am getting.
Ankur Ankan
@ankurankan
@jonvaljohn Hmm, it's working fine on my machine. Could you tell me your python version and dependency packages' versions?