Skip to content

Commit

Permalink
update unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
erdogant committed Sep 24, 2021
1 parent 9ae0d3b commit f2bb25a
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions tests/test_bnlearn.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# pip install pytest
# pytest tests\test_bn.py

import bnlearn as bn
from pgmpy.factors.discrete import TabularCPD
import numpy as np

import pandas as pd
import matplotlib.pyplot as plt
from pgmpy.estimators import TreeSearch
from pgmpy.models import BayesianModel
import networkx as nx
import bnlearn as bnlearn
from pgmpy.inference import VariableElimination
from pgmpy.estimators import BDeuScore, K2Score, BicScore
import bnlearn as bn

def test_import_DAG():
DAG = bn.import_DAG('Sprinkler')
Expand Down Expand Up @@ -131,18 +138,6 @@ def test_structure_learning():
model = bn.structure_learning.fit(df, methodtype='tan', white_list=['smoke', 'either'], bw_list_method='nodes', root_node='smoke', class_node='either')
assert np.all(model['adjmat'].columns.values==['smoke', 'either'])

# COMPARE WITH RESULTS PGMPY
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from pgmpy.estimators import TreeSearch
from pgmpy.models import BayesianModel
import networkx as nx
import bnlearn as bnlearn
from pgmpy.inference import VariableElimination
from pgmpy.estimators import BDeuScore, K2Score, BicScore
import bnlearn as bn


df=bnlearn.import_example(data='andes')

Expand Down

0 comments on commit f2bb25a

Please sign in to comment.