andrey.metrics.causal_order_scores#
- andrey.metrics.causal_order_scores(order, true_dag)[source]#
Accuracy, Kendall tau, and comparable-pair count of an order against a true DAG.
accuracyis the fraction of true ancestral pairs the order sequences correctly;kendall_tauis2 * accuracy - 1over those comparable pairs;n_comparable_pairsis how many ancestral pairs exist (so tau and accuracy carry distinct information). A valid topological order scores accuracy 1.0; an order with no comparable pairs scores 1.0 / tau 1.0.Examples
>>> causal_order_scores([0, 1, 2], [[0, 1, 0], [0, 0, 1], [0, 0, 0]])["accuracy"] 1.0