GPR Algorithm
An implementation of an extremely simple classifier (GPR) that consists of highly interpretable fuzzy metarules and is suitable for many applications. GPR is effective in accuracy and area under the receiver operating characteristic (ROC) curve. We provide a Python implementation of the GPR algorithm to enable the use of the algorithm without using commercial software tools and open access to the research community. We also added enhancements to facilitate the reading and interpretation of the rules.
Example usage
import numpy as np
from gpr_algorithm import GPR
feature_names = ['weight', 'height']
target_names = ['sick', 'healthy']
cls = GPR(
feature_names=feature_names,
target_names=target_names,
max_n_of_rules=2, max_n_of_ands=2, n_generations=10, n_populations=10,
verbose=False
)
attributes = np.array([
[.9, .1], # sick
[1., .9], # sick
[0., .9],
[.1, .1]
])
labels = np.array([
0, # sick
0, # sick
1,
1
])
cls.fit(attributes, labels)
pred_labels = cls.predict(attributes)
assert np.all(labels == pred_labels)
rules = cls.rules
assert rules == ['IF weight is Low THEN healthy | Support: 0.9500', 'ELSE sick']
Metadata
Release files for gpr-algorithm 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gpr-algorithm-1.0.0.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gpr_algorithm-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.1 kB
Release files / gpr-algorithm-1.0.0.tar.gz
| Download URL | gpr-algorithm-1.0.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
45407fbad155008e82a30d665144ce8f3534ed30478f844d71fb02bbbd94e645
|
|
BLAKE2b-256 checksum How to use checksums |
6c4ee7aef95a62d694fdb3c2527acb475feb11e4fa52c33463a4f291329ec686
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.8.6 Windows/10
|
Release files / gpr_algorithm-1.0.0-py3-none-any.whl
| Download URL | gpr_algorithm-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
05eb3f618f9798294d60c089d0595d7880427ac571669de50b9ff2a566eee605
|
|
BLAKE2b-256 checksum How to use checksums |
d41d30f9ccd783cef0f558d5cf792215a4d5e301012fb98e818691e4e0741d37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.8.6 Windows/10
|