Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 05 16:16
    ankurankan opened #1197
  • Dec 05 14:16

    ankurankan on dev

    Updates version number (compare)

  • Dec 05 14:16
    ankurankan closed #1196
  • Dec 05 14:15
    codecov[bot] commented #1196
  • Dec 05 14:13
    codecov[bot] commented #1196
  • Dec 05 13:33
    ankurankan closed #1192
  • Dec 05 13:33

    ankurankan on dev

    Removes six as a dependency [fi… (compare)

  • Dec 05 13:33
    ankurankan closed #1195
  • Dec 05 13:22
    ankurankan opened #1195
  • Dec 05 12:59

    ankurankan on dev

    Updates python version in docs (compare)

  • Dec 05 12:59
    ankurankan closed #1194
  • Dec 05 12:59

    ankurankan on dev

    Refactor NaiveBayes: 1. Change… (compare)

  • Dec 05 12:59
    ankurankan closed #1193
  • Dec 05 12:37
    ankurankan opened #1194
  • Dec 05 12:36
    ankurankan opened #1193
  • Dec 05 10:51
    ankurankan assigned #1192
  • Dec 05 10:51
    ankurankan opened #1192
  • Dec 05 10:12
    ankurankan closed #1190
  • Dec 05 10:12
    ankurankan closed #1191
  • Dec 05 10:12
    ankurankan commented #1191
abbasi72
@abbasi72
image.png
image.png
image.png
Danish A. Alvi
@DanishAAlvi_twitter
@ankurankan Take a look at my project! Thank you for your help all the way with my journey! pgmpy is a wonderful tool with an unlimited potential, and there is a lot more that can be done with it.
odirar
@odirar
@ankurankan hey everyone, newbie to pgmpy, seem to have hit an issue that im not quite sure how to fix. In trying to implement the example on pg 190 of chapter 5, i seem to be getting empty cpds (and model) for some reason. ive provided some screenshots below to help clarify the issue im having. i think this is due to the versions of networkx, scipy, numpy and pandas that im using but im not sure. can you guys please help?
pgmissue1.PNG
pgmissue2.PNG
Utkarsh
@khalibartan
@odirar I see, you haven't added any edges in the model. For parameter estimation you must first specify the structure of model.
odirar
@odirar
@khalibartan ahh see ok thanks. How would i go about doing both structure and parameter learning from a dataset? Would i do it as described in /pgmpy/pgmpy_notebook/notebooks/9. Learning Bayesian Networks from Data.ipynb in the repo? or is there perhaps an alternate way of doing this? thanks again. (https://github.com/pgmpy/pgmpy_notebook/blob/master/notebooks/9.%20Learning%20Bayesian%20Networks%20from%20Data.ipynb)
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.