Score Functions - Gaussian Kernels¶
Gaussian score kernels used by the score module. They were
extracted into this sibling module so that causaliq_data.score stays within
the module size limits described in the
development policy.
Every name is re-exported from causaliq_data.score, so import paths are
unchanged.
Bayesian Gaussian Equivalent¶
bayesian_gaussian_score
¶
bayesian_gaussian_score(
node: str, parents: Dict[str, List[str]], params: Dict[str, Any], data: Data
) -> float
Compute Bayesian Gaussian Equivalent (BGE) for a node.
Computes BGE for a node with specified parents. Based on the cwpost/wpost functions in bnlearn which are in turn derived from Kuipers et al, 2014, Annals of Statistics which corrects the orginal formulation by Geiger and Heckerman (2002). Variable names follow those in equation (2) of Kuipers et al. This implementation is simplified so that some hyperparameters have the bnlearn default values: - alpha_mu = 1.0 - weight assigned to prior means - nu = observed means - prior means for each variable - alpha_w = n + 2 - weight assigned to prior variances
Parameters:
-
(node¶str) –Node scores are required for.
-
(parents¶dict) –Parents of non-orphan nodes {node: [parents]}.
-
(params¶dict) –Parameters for scores e.g. logarithm base.
-
(data¶Data) –Data to learn graph from.
Returns:
-
float(float) –BGE score.
Entropy Gaussian Scores¶
entropy_gaussian_score
¶
entropy_gaussian_score(
node: str, parents: Dict[str, List[str]], params: Dict[str, Any], data: Data
) -> Dict[str, float]
Return entropy-based scores for a Gaussian node.
Parameters:
-
(node¶str) –Node scores are required for.
-
(parents¶dict) –Parents of non-orphan nodes {node: [parents]}.
-
(params¶dict) –Parameters for scores e.g. logarithm base.
-
(data¶Data) –Data to learn graph from.
Returns:
-
dict(Dict[str, float]) –{'bic-g': float, 'loglik-g': float}.