ankurankan on dev
Updates doc copyright; Also fix… (compare)
ankurankan on dev
Adds CI tests documentation to … Replace the independence symbol… (compare)
ankurankan on dev
Fixes latex output of get_indep… (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...
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)