srlearn: A Python Library for Gradient-Boosted Statistical Relational Models

Alexander L. Hayes

Accepted at the Ninth International Workshop on Statistical Relational AI - StarAI 2020.


Explore further on GitHub.

srlearn overview

srlearn has several aims. At a basic level it wraps the state-of-the-art BoostSRL package for learning the structure and parameters of statistical relational models. At a higher level, it is an ongoing experiment in creating application programming interfaces (APIs) that blend idea from logic programming with what is familiar to the machine learning and data science communities built around the Python programming language.

This example is presented as Figure 1 in the paper, and is presently featured as one of the getting started examples in the srlearn documentation:

>>> from srlearn.rdn import BoostedRDN
>>> from srlearn import Background
>>> from srlearn import example_data
>>> bk = Background(
...     modes=example_data.train.modes,
...     use_std_logic_variables=True,
... )
>>> clf = BoostedRDN(
...     background=bk,
...     target='cancer',
... )
>>> clf.predict_proba(example_data.test)
array([0.88079619, 0.88079619, 0.88079619, 0.3075821 , 0.3075821 ])
>>> clf.classes_
array([1., 1., 1., 0., 0.])


Results of the paper are based on srlearn==0.5.0

Please consider starring ūüĆü the srlearn GitHub Repository repository. It‚Äôs an open-source project, so any feedback or recommendations are appreciated.


Scripts for reproducing Table 1 are contained in the experiments/ directory on GitHub.


Please use the following citation when building on ideas of this work:

  title={srlearn: A Python Library for Gradient-Boosted Statistical Relational Models},
  author={Alexander L. Hayes},


ALH is sponsored through Indiana University‚Äôs ‚ÄúPrecision Health Initiative‚ÄĚ (PHI) Grand Challenge. ALH would like to thank Sriraam Natarajan, Travis LaGrone, and members of the StARLinG Lab at the University of Texas at Dallas.