Skip to main content

Interpretable rule ensembles via gradient boosting

Project description

ruleboost

Learn additive rule ensembles via gradient boosting.

Usage

>>> from ruleboost import RuleBoostingClassifier
>>> from optikon import full_propositionalization
>>> import numpy as np
>>> x = np.array([[0.1], [0.2], [0.3], [0.4], [0.5], [0.6], [0.7], [0.8], [0.9]])
>>> y = np.array([0, 0, 0, 1, 1, 1, 0, 0, 0])
>>> model = RuleBoostingClassifier(num_rules=1, fit_intercept=True, prop=full_propositionalization).fit(x, y)
>>> print(model.rules_str()) # doctest: +NORMALIZE_WHITESPACE
    -0.475 if  
    +0.675 if x1 >= 0.400 & x1 <= 0.600
>>> model.predict(x)
array([0, 0, 0, 1, 1, 1, 0, 0, 0])
>>> np.round(model.predict_proba(x)[:, 1], 2)
array([0.38, 0.38, 0.38, 0.55, 0.55, 0.55, 0.38, 0.38, 0.38])

Project details


Download files

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

Source Distribution

ruleboost-0.2.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ruleboost-0.2.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file ruleboost-0.2.0.tar.gz.

File metadata

  • Download URL: ruleboost-0.2.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for ruleboost-0.2.0.tar.gz
Algorithm Hash digest
SHA256 53d19fc6b2b4587b0e3ce57dbf0296c3096d78e24d7b26fd8b6cc858e946167f
MD5 51c40f6d43cf58252342ad7ce85ad7dc
BLAKE2b-256 fcbbf75f2ee8be784ba15f85f3a02cdfa6b2578b072dc56ddf1c8f1a8eb20824

See more details on using hashes here.

File details

Details for the file ruleboost-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ruleboost-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for ruleboost-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55457bde8ab283955a8d2a97477f306663ae633e29441377280a8d3767b8dfee
MD5 a63336a065c748ee29fd1a346168d4db
BLAKE2b-256 c590325b16961c0345729ad392a5940392237127ecd310cb556b2e16b0ede5ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page