conferences | speakers | series

Lea, a probability engine in Python

home

Lea, a probability engine in Python
FOSDEM 2015

Lea is a Python open-source module dedicated to discrete probability distributions. It allows modelling uncertain information and derive probabilities in an intuitive way. It provides means to build random variables with given probability distributions, probability calculus with integers, standard indicators, conditional probabilities and generation of random samples. The forthcoming Lea 2 (should be ready for FOSDEM 2015!) shall include Bayesian reasoning, Markov chains and a high-level PPL (Probability Programming Language).

Lea is a Python package aiming at working with discrete probability distributions in an intuitive way. It allows modelling a broad range of random phenomenons, like dice throwing, coin tossing, cards hands, gambling, lottery, … with fair or unfair characteristics! More generally, Lea may be used for any finite set of discrete values having known probability: numbers, boolean variables, date/times, symbols, ...

Each probability distribution is modelled as a plain object, which can be named, displayed, queried or processed to produce new distribution objects. Lea provides standard indicators, conditional probabilities and generation of random samples. The forthcoming Lea 2 (should be ready for FOSDEM 2015!) shall include Bayesian reasoning, Markov chains and "Leash", a high-level PPL (Probability Programming Language).

On an implementation point of view, probabilities are stored using integers (e.g. not float), allowing to avoid any risk of rounding errors. Lea implementation heavily relies on Python's operator overloading, generators and duck-typing.

Speakers: Pierre Denis