KTBNAdaptiveLearner.usePC

KTBNAdaptiveLearner.usePC()

Use the constraint-based PC algorithm for structure search.

The significance threshold is the key alpha of the section learning of the configuration.

Returns:

the learner itself, for chaining

Return type:

pyagrum.ktbn.KTBNLearner or pyagrum.ktbn.KTBNAdaptiveLearner

Example

import pyagrum as gum
import pyagrum.ktbn as ktbn

gum.initRandom(42)
model = ktbn.KTBN.fromBN(gum.fastBN("X0->X1->Y1;Y0"))
ktbn.KTBNDatabaseGenerator(model).drawSamples(50, 10, ".", "traj")  # traj1.csv ... traj50.csv
learner = ktbn.KTBNAdaptiveLearner(".", "traj", 50, 3, gum.fastBN("X;Y"))  # k in [2, 3]
learner.usePC()
dict(s[:2] for s in learner.state())["Algorithm"]
# 'PC'
learner.learnKTBN().k()
# 2

Class

KTBNAdaptiveLearner