Scores

class lgbn.scores.BICScore(data)

The Bayesian Information Criterion score of a network is the LogLikScore of that network minus a regularization penalty proportional to the size of the data and the complexity of the network.

This score is decomposable and thus takes advantage of caching.

For a complete description of the BIC score see 1 section 18.3.5.

References

1(1,2)

D. Koller and N. Friedman, Probabilistic graphical models: principles and techniques. Cambridge, MA: MIT Press, 2009.

data: DataFrame

A Pandas DataFrame with one row per observation and one column per variable.

class lgbn.scores.BaseScore(data: DataFrame)

The base class for network scores.

A score is a class that takes an argument data on initialization and that implements a score(network) method that when given a network returns a real number.

This base class also stubs the implementation for a decomposable score, where the .score(network) function can be obtained by summing the .score_fam(node, parent) method over the nodes in a network.

data: DataFrame

A Pandas DataFrame with one row per observation and one column per variable.

score(net: BayesianNetwork)

A default implementation for decomposable scores where the score of a network is the sum of the scores of each family (i.e. the set of a node and its parents).

class lgbn.scores.LogLikScore(data: DataFrame)

The LogLik score of a network is the (natural) logarithm of the maximum likelihood of the data given the network as estimated by net.mle().

This score is decomposable and thus takes advantage of caching.

See section 18.3.1 of 1 for a more in-depth discussion of the log likelihood score.

data: DataFrame

A Pandas DataFrame with one row per observation and one column per variable.