Skip to main content

Python wrappers for using BoostSRL jar files.

Project description

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

License LGTM code quality analysis Travis CI continuous integration build status AppVeyor Windows build status Code coverage status CircleCI Documentation status

srlearn is a set of Python wrappers around BoostSRL with a scikit-learn interface.

Getting Started

Prerequisites:

  • Java 1.8
  • Python (3.6, 3.7)

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 ‘example_data’) is:

>>> 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.fit(example_data.train)
>>> 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.])

example_data.train and example_data.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.

Contributing

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.

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for srlearn, version 0.5.0
Filename, size File type Python version Upload date Hashes
Filename, size srlearn-0.5.0-py3-none-any.whl (4.1 MB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size srlearn-0.5.0.tar.gz (4.1 MB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page