def create_factors_dict(data, dtree_root, alpha):
    (probs, j_probs) = compute_probs(data, alpha)
    scope = dtree_root.get_tree()[0]
    tree = dtree_root.get_tree()[1]
    factors = compute_factors(probs, j_probs, tree)
    factors_dict = {var: factors[scope.index(var)] for var in scope}
    return factors_dict
def create_factors_dict(data, dtree_root, alpha):
    (probs, j_probs) = compute_probs(data, alpha)
    scope = dtree_root.get_tree()[0]
    tree = dtree_root.get_tree()[1]
    factors = compute_factors(probs, j_probs, tree)
    factors_dict = {var: factors[scope.index(var)] for var in scope}
    return factors_dict