BNLearner.setFCIExhaustiveSepSet
- BNLearner.setFCIExhaustiveSepSet(exhaustive)
Enable or disable exhaustive separating-set mode for the FCI skeleton phase.
In standard mode (default,
False) FCI stops at the first separating set found for each pair of nodes at each conditioning depth. In exhaustive mode (True) it tests all subsets of that depth and stores the union of all separating sets found. A wider separating set suppresses more collider orientations (conservative), at the cost of more independence tests.- Parameters:
exhaustive (
bool) –Trueto enable exhaustive mode,Falseto restore standard mode.- Returns:
the BNLearner itself, to allow method chaining.
- Return type:
- Raises:
pyagrum.OperationNotAllowed – If FCI has not been selected (call
useFCI()first).
Example
import pyagrum as gum
with open("data.csv", "w") as f: # C is mostly "A or B"
f.write("A,B,C\n" + "0,0,0\n0,1,1\n1,0,1\n1,1,1\n" * 40 + "0,0,1\n0,1,0\n1,0,0\n1,1,0\n" * 5)
learner = gum.BNLearner("data.csv")
learner.useFCI()
learner.fciExhaustiveSepSet()
# False
learner.setFCIExhaustiveSepSet(True)
learner.fciExhaustiveSepSet()
# True
Class