pair_polish#

causalbase.order.pair_polish(score, dag, n_candidates=10)[source]#

Add parents (singly, or in pairs when no single one helps) until no node improves.

Parameters:
scoreFamilyScore

The score; a BDeuScore scores the families with its compiled engine.

dagDAG

Starting graph; its arcs are kept.

n_candidatesint, default=10

Pairs are drawn from this many best single candidates; 0 turns pairs off, leaving a greedy single-addition climb.

Returns:
tuple

The DAG, the score gained and the number of pair moves applied.