MAG.fromPAG
- static MAG.fromPAG(pag)
A representative MAG of the Markov equivalence class represented by a PAG (Zhang 2008, Artificial Intelligence, Theorem 2): the edges
o->and--obecome->, and the edgeso-oare oriented into a DAG without unshielded collider.- Parameters:
pag (
pyagrum.PAG) – the PAG- Return type:
- Raises:
pyagrum.InvalidArgument – if the PAG is not valid
Example
import pyagrum as gum
pag = gum.fastPAG("A o-> B;B <-o C")
print(gum.MAG.fromPAG(pag))
# {0<A>,1<B>,2<C>} , {0 --> 1, 1 <-- 2}
Class