graphical_models.classes.dags.dag.DAG.chickering_distance
- DAG.chickering_distance(other) int [source]
Return the total number of edge reversals plus twice the number of edge additions/deletions required to turn this DAG into the DAG
other
.- Parameters
other – the DAG against which to compare the Chickering distance.
- Returns
The Chickering distance between this DAG and the DAG
other
.- Return type
int
Examples
>>> from graphical_models import DAG >>> d1 = DAG(arcs={(0, 1), (1, 2)}) >>> d2 = DAG(arcs={(0, 1), (2, 1), (3, 1)}) >>> d1.chickering_distance(d2) 3