|
|
|
@ -16,9 +16,6 @@ import structure_graph.sample_path as sp |
|
|
|
|
import estimators.structure_score_based_estimator as se |
|
|
|
|
import utility.json_importer as ji |
|
|
|
|
|
|
|
|
|
from multiprocessing import set_start_method |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestStructureScoreBasedEstimator(unittest.TestCase): |
|
|
|
@ -26,7 +23,7 @@ class TestStructureScoreBasedEstimator(unittest.TestCase): |
|
|
|
|
@classmethod |
|
|
|
|
def setUpClass(cls): |
|
|
|
|
#cls.read_files = glob.glob(os.path.join('../../data', "*.json")) |
|
|
|
|
cls.importer = ji.JsonImporter("../../data/networks_and_trajectories_ternary_data_15.json", 'samples', 'dyn.str', 'variables', 'Time', 'Name') |
|
|
|
|
cls.importer = ji.JsonImporter("../../data/networks_and_trajectories_binary_data_10.json", 'samples', 'dyn.str', 'variables', 'Time', 'Name') |
|
|
|
|
cls.s1 = sp.SamplePath(cls.importer) |
|
|
|
|
cls.s1.build_trajectories() |
|
|
|
|
cls.s1.build_structure() |
|
|
|
@ -37,7 +34,7 @@ class TestStructureScoreBasedEstimator(unittest.TestCase): |
|
|
|
|
true_edges = copy.deepcopy(self.s1.structure.edges) |
|
|
|
|
true_edges = set(map(tuple, true_edges)) |
|
|
|
|
|
|
|
|
|
set_start_method("spawn") |
|
|
|
|
|
|
|
|
|
se1 = se.StructureScoreBasedEstimator(self.s1) |
|
|
|
|
edges = se1.estimate_structure( |
|
|
|
|
max_parents = None, |
|
|
|
@ -46,7 +43,7 @@ class TestStructureScoreBasedEstimator(unittest.TestCase): |
|
|
|
|
tabu_length = 15, |
|
|
|
|
tabu_rules_duration = 15, |
|
|
|
|
optimizer = 'tabu', |
|
|
|
|
disable_multiprocessing=False |
|
|
|
|
disable_multiprocessing=True |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|