CLGLearner.Repeat_II
- CLGLearner.Repeat_II(order, C, l, verbose=False)
This function is the second part of the Step1 of PC algorithm.
- Parameters:
order (
list[int]) – The order of the variables.C (
dict[int,set[int]]) – The temporary skeleton.l (
int) – The size of the sepsetverbose (
bool) – Whether to print.
- Returns:
found_edge – True if a new edge is found, False if not.
- Return type:
bool
Example
import pyagrum as gum
import pyagrum.clg as gclg
gum.initRandom(42) # the draws of pyagrum.clg come from the random generator of aGrUM
clg = gclg.SEM.toclg("""
A = 0[1]
B = 2A[1]
C = -1.5B[1]
""")
gclg.ForwardSampling(clg).makeSample(2000).tocsv("data.csv")
learner = gclg.CLGLearner("data.csv")
C = {0: {1, 2}, 1: {0, 2}, 2: {0, 1}} # the complete skeleton
learner.Repeat_II([0, 1, 2], C, 1) # tests with separating sets of size 1
# True
C
# {0: {1}, 1: {0, 2}, 2: {1}}
Class