Efficient interpretable rule ensemble learning via gradient boosting implemented with numba.
Project description
RuleBoost
Learn additive rule ensembles via gradient boosting.
Usage Example for Classification
>>> from ruleboost import RuleBoostingClassifier
>>> 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).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.4.0.tar.gz
(5.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ruleboost-0.4.0.tar.gz.
File metadata
- Download URL: ruleboost-0.4.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b873d21847ee69f140bf1dc750d1017161b03b2da222e0371cbaa7f29c5779f
|
|
| MD5 |
007f571f777e33ba38e122d124de7ce9
|
|
| BLAKE2b-256 |
562dd275c5a3f0cd14ddaa74d2f1d40ea169541eda98436d4b2d6104ccf16ecb
|
File details
Details for the file ruleboost-0.4.0-py3-none-any.whl.
File metadata
- Download URL: ruleboost-0.4.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7803324ae267ea21941853fd90f48f9b4660528ae723253b17984025396650e7
|
|
| MD5 |
33d0aaea5cf2fbf8a7a3d3de34f71e69
|
|
| BLAKE2b-256 |
854d73102ebbb54f3b01e26fd0bb972899c597098bea9ef62cb310bc750a40cf
|