Getting Started

Halerium can be either used online on the Halerium platform or locally as a pure Python package. To get your test account for the Halerium platform visit For local usage follow the installation instructions:

High level usage

For the most common applications Halerium offers the convenient CausalStructure class at the package level. With this class you can easily create, train and evaluate Bayesian models with just a couple of lines.

from halerium import CausalStructure
causal_structure = CausalStructure([input_columns, output_columns])

To learn more about the usage of the high-level package check out

Low level usage

With the halerium.core package you can build custom tailored Halerium graphs, with which you can model arbitrarily complex processes. You choose how much knowledge is hard-coded into your graph and how much is to be learned from data.

Build deep hierarchical graphs with Variables of arbitrary dimensions and complex tensor operations. Combine a graph with incomplete data and let halerium solve your model for you. Utilize the powerful combination of Bayesian inference and machine learning without caring about the statistical details!

import halerium.core as hal

with hal.Graph("g") as g:
    hal.Variable("x", shape=(3, 5), mean=0., variance=1.)
    hal.Variable("y", shape=(3,))
    y.mean = hal.sigmoid(hal.sum(x, axis=1))
    y.variance = hal.tensordot(x, x, axes=2)

model = hal.get_posterior_model(g, data={g.y: [1, 2, 3]})

>>> array([[[0.14381036, 0.14378252, 0.14378723, 0.14380088, 0.14379767],
            [0.32230996, 0.32230319, 0.3222988 , 0.3222934 , 0.32231929],
            [0.41568274, 0.41570946, 0.41568607, 0.41570675, 0.41571199]]])

Check out the in-a-nutshell introduction in

Find more examples and the code overview in

The advantages of halerium.core compared to conventional machine learning are illustrated in the advantages section.