ankurankan on dev
Updates version number (compare)
ankurankan on dev
Removes six as a dependency [fi… (compare)
ankurankan on dev
Updates python version in docs (compare)
ankurankan on dev
Refactor NaiveBayes: 1. Change… (compare)
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.
+-------------------------------------+-----------+
| 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...