BICScore#

class causalbase.scores.BICScore(data, *, penalty_discount=1.0, expected_parents=1.0, n_jobs=1)[source]#

BIC local score over a discrete dataset, memoised per family.

The maximised log likelihood of a family less penalty_discount * log(n) / 2 per free parameter, q * (r - 1) for a child of r levels whose parents take q joint configurations, plus the structure prior of FamilyScore.

Parameters:
dataDiscreteDataset

The data to score against.

penalty_discountfloat, default=1.0

Multiplies the penalty; larger values give sparser structures.

expected_parentsfloat or None, default=1.0

Expected number of parents per node under the structure prior, as in BDeuScore. None is the plain BIC.

n_jobsint, default=1

Threads of the compiled kernels for large batches of candidate parents and for the exact search; -1 is every thread numba has. Results do not depend on it.

Notes

Not safe to share between threads, for the reasons given in BDeuScore.

compute_family(node, parents)[source]#

Return the maximised log likelihood less the BIC penalty.

compute_extensions(node, parents, extra)[source]#

Return the BIC of every extension, counted together.