All Projects → srlearn → srlearn

srlearn / srlearn

Licence: GPL-3.0 license
☕ A Python library for gradient-boosted statistical relational models / learning probabilistic relational programs.

Programming Languages

python
139335 projects - #7 most used programming language
prolog
421 projects
Makefile
30231 projects

Projects that are alternatives of or similar to srlearn

Ampligraph
Python library for Representation Learning on Knowledge Graphs https://docs.ampligraph.org
Stars: ✭ 1,662 (+7126.09%)
Mutual labels:  relational-learning
kglib
TypeDB-ML is the Machine Learning integrations library for TypeDB
Stars: ✭ 523 (+2173.91%)
Mutual labels:  relational-learning
EDSR-ssim
Different SSIM metrics in CNN-based super resolution algorithms (e.g., EDSR CVPRW2017, RDN CVPR2018, MSRN ECCV2018).
Stars: ✭ 32 (+39.13%)
Mutual labels:  rdn
FigureQA-baseline
TensorFlow implementation of the CNN-LSTM, Relation Network and text-only baselines for the paper "FigureQA: An Annotated Figure Dataset for Visual Reasoning"
Stars: ✭ 28 (+21.74%)
Mutual labels:  relational-reasoning
3DCSGNet
CSGNet for voxel based input
Stars: ✭ 34 (+47.83%)
Mutual labels:  program-induction
Popper
Popper is an inductive logic programming (ILP) system.
Stars: ✭ 95 (+313.04%)
Mutual labels:  program-induction

srlearn

Repository preview image: "srlearn. Python wrappers around BoostSRL with a scikit-learn-style interface. pip install srlearn."

License LGTM code quality analysis GitHub CI Builds Code coverage status Documentation status

srlearn is a Python package for learning statistical relational models, and wraps BoostSRL (and other implementations) with a scikit-learn interface.

Getting Started

Prerequisites:

  • Java (1.8, 1.11)
  • Python (3.7, 3.8, 3.9, 3.10)

Installation

pip install srlearn

Basic Usage

The general setup should be similar to scikit-learn. But there are a few extra requirements in terms of setting background knowledge and formatting the data.

A minimal working example (using the Toy-Cancer data set imported with 'load_toy_cancer') is:

from srlearn.rdn import BoostedRDNClassifier
from srlearn import Background
from srlearn.datasets import load_toy_cancer
train, test = load_toy_cancer()
bk = Background(modes=train.modes)
clf = BoostedRDNClassifier(
    background=bk,
    target='cancer',
)
clf.fit(train)
clf.predict_proba(test)
# array([0.88079619, 0.88079619, 0.88079619, 0.3075821 , 0.3075821 ])
print(clf.classes_)
# array([1., 1., 1., 0., 0.])

train and test are each srlearn.Database objects, so this hides some of the complexity behind the scenes.

This example abstracts away some complexity in exchange for compactness. For more examples, see the Example Gallery.

Citing

If you find this helpful in your work, please consider citing:

@misc{hayes2019srlearn,
  title={srlearn: A Python Library for Gradient-Boosted Statistical Relational Models},
  author={Alexander L. Hayes},
  year={2019},
  eprint={1912.08198},
  archivePrefix={arXiv},
  primaryClass={cs.LG}
}

Contributing

Many thanks to those who have already made contributions:

Many thanks to the known and unknown contributors to WILL/BoostSRL/SRLBoost, including: Navdeep Kaur, Nandini Ramanan, Srijita Das, Mayukh Das, Kaushik Roy, Devendra Singh Dhami, Shuo Yang, Phillip Odom, Tushar Khot, Gautam Kunapuli, Sriraam Natarajan, Trevor Walker, and Jude W. Shavlik.

We have adopted the Contributor Covenant Code of Conduct version 1.4. Please read, follow, and report any incidents which violate this.

Questions, Issues, and Pull Requests are welcome. Please refer to CONTRIBUTING.md for information on submitting issues and pull requests.

Versioning and Releases

We use SemVer for versioning. See Releases for stable versions that are available, or the Project Page on PyPi.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].