prior – Prior models

This module provides classes for representing and working with prior models.

class pebl.prior.Prior(num_nodes, energy_matrix=None, required_edges=[], prohibited_edges=[], constraints=[], weight=1.0)

Class for representing prior model.

Priors have two aspects:
  • soft priors: weights for each possible edge.
  • hard priors: constraints that MUST be met.

Soft priors are specified by an energy matrix, a weight matrix taking values over [0,1.0].

Hard priors are specified as:
  • required_edges: a list of edge-tuples that must be rpesent

  • prohibited_edges: a list of edge-tuples that must not be present

  • constraints: a list of functions that take adjacency matrix as input

    and return true if constraint met and false otherwise.

For more information about calculating prior probabilities via energy matrices, consult:

  1. Imoto, S. and Higuchi, T. and Goto, T. and Tashiro, K. and Kuhara, S. and Miyano, S. Combining microarrays and biological knowledge for estimating gene networks via Bayesian networks. Proc IEEE Comput Soc Bioinform Conf. 2003, p.104-113.
loglikelihood(net)

Returns the log likelihood of the given network.

Similar to the loglikelihood method of a Conditional Probability Distribution.

class pebl.prior.UniformPrior(num_nodes, weight=1.0)

A uniform prior – that is, every edge is equally likely.

class pebl.prior.NullPrior(*args, **kwargs)

A null prior which returns 0.0 for the loglikelihood.

The name for this object is a bit confusing because the UniformPrior is often considered the null prior in that it doesn’t favor any edge more than another. It still favors smaller networks and takes time to calculate the loglikelihood. This class provides an implementation that simply returns 0.0 for the loglikelihood. It’s a null prior in the sense that the resulting scores are the same as if you hadn’t used a prior at all.

Previous topic

posterior – Posterior distribution

Next topic

result – Learner results

This Page