make_score#

causalbase.scores.make_score(name, data, *, ess=1.0, expected_parents=1.0, prior='bernoulli', penalty_discount=1.0, alpha_w=None, n_jobs=1)[source]#

Return the score called name over data.

Every estimator builds its score here, so each parameter means the same in all of them; one a score does not use is ignored.

Parameters:
name{“bdeu”, “bic”, “gaussian_bic”, “bge”}

BDeuScore and BICScore take a DiscreteDataset, GaussianBICScore and BGeScore a ContinuousDataset.

dataDiscreteDataset or ContinuousDataset

The data to score against.

essfloat, default=1.0

Equivalent sample size: of the BDeu prior, and of BGe’s prior on the mean (its alpha_mu).

expected_parentsfloat or None, default=1.0

Structure prior, for every score; see FamilyScore.

prior{“bernoulli”, “tetrad”}, default=”bernoulli”

Which structure prior; "tetrad" (Tetrad 7.6.5’s) for BDeu only, see BDeuScore.

penalty_discountfloat, default=1.0

Multiplier of the penalty of the two BIC scores.

alpha_wfloat or None, default=None

Degrees of freedom of BGe’s Wishart prior; see BGeScore.

n_jobsint, default=1

Threads of the score’s compiled kernels; -1 is every thread numba has.

Raises:
ValueError

If name is not one of the four, prior is unknown or not one of the score’s, or a parameter is out of the score’s range.

TypeError

If data is not the kind of dataset the score takes.