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)
+-------------------------------------+-----------+
| 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)
from pgmpy.factors.discrete import TabularCPD
from pgmpy.models import DynamicBayesianNetwork as DBN
from pgmpy.inference import DBNInference
dbn = DBN()
#dbn.add_edges_from([(('M',0), ('S', 0)), (('S',0), ('S', 1)), (('S', 0), ('J', 0)) ])
dbn.add_edges_from([(('M',1), ('S', 1)), (('S', 1), ('J', 1)), (('S',0), ('S', 1)) ])
#S_cpd = TabularCPD (('S',0), 2, [[0.5, 0.5]]) # Prior the state should go 50/50
M_cpd = TabularCPD (('M',1), 2, [[0.5, 0.5]]) # Prior the model should go 50/50
M_S_S_cpd = TabularCPD(variable = ('S',1), variable_card=2,
values = [[0.95, 0.3, 0.1, 0.05],
[0.05, 0.7, 0.9, 0.95]],
evidence=[ ('M', 1), ('S', 0)],
evidence_card=[2, 2])
S_J_cpd = TabularCPD(('J',1), 2, [[0.9, 0.1],
[0.1, 0.9]],
evidence=[('S',1)],
evidence_card=[2])
dbn.add_cpds(M_cpd, M_S_S_cpd, S_J_cpd)
dbn_inf = DBNInference(dbn)
dbn_inf.forward_inference([('J', 2)], { ('M', 1):0, ('M', 2):0, ('S', 0): 0})