Skip to main content

MDL Rule Lists for prediction and data mining

This repository contains the code for using rule lists for univariate or multivariate classification or regression and its equivalents in Data Mining and Subgroup Discovery. These models use the Minimum Description Length (MDL) principle as optimality criteria.

Dependencies

This project was written for Python 3.7. All required packages from PyPI are specified in the requirements.txt.

NOTE: This list of packages includes the gmpy2 package.

Example of usage:

import pandas as pd
from rulelist import RuleList
from sklearn import datasets
from sklearn.model_selection import train_test_split

task = 'prediction'
target_model = 'categorical'

data = datasets.load_breast_cancer()
Y = pd.Series(data.target)
X = pd.DataFrame(data.data)

X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size = 0.3)

model = RuleList(task = task, target_model = target_model)

model.fit(X_train, y_train)

y_pred = model.predict(X_test)
from sklearn.metrics import accuracy_score
accuracy_score(y_test.values,y_pred)

print(model)

Contact

If there are any questions or issues, please contact me by mail at hugo.manuel.proenca@gmail.com or open an issue here on Github.

Citation

In a machine learning (prediction) context for problems of classification, regression, multi-label classification, multi-category classification, or multivariate regression cite the corresponding bibtex of the first classification application of MDL rule lists:

@article{proencca2020interpretable,
  title={Interpretable multiclass classification by MDL-based rule lists},
  author={Proen{\c{c}}a, Hugo M and van Leeuwen, Matthijs},
  journal={Information Sciences},
  volume={512},
  pages={1372--1393},
  year={2020},
  publisher={Elsevier}
}

in the context of data mining and subgroup discovery please refer to subgroup lists:

@article{proencca2020discovering,
  title={Discovering outstanding subgroup lists for numeric targets using MDL},
  author={Proen{\c{c}}a, Hugo M and Gr{\"u}nwald, Peter and B{\"a}ck, Thomas and van Leeuwen, Matthijs},
  journal={arXiv preprint arXiv:2006.09186},
  year={2020}
} 

References

Download files

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

Source Distribution

rulelist-0.0.2.tar.gz (35.9 kB view details)

Uploaded Source

Built Distribution

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

rulelist-0.0.2-py3-none-any.whl (53.8 kB view details)

Uploaded Python 3

File details

Details for the file rulelist-0.0.2.tar.gz.

File metadata

  • Download URL: rulelist-0.0.2.tar.gz
  • Upload date:
  • Size: 35.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for rulelist-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9b8a8b2569470fb380342cf6bcbccd9c2b8d03d3f49b4bb0fbc1cc13717e7735
MD5 a248e7465f71253439accd5920458db4
BLAKE2b-256 f33419522ff58837cb24d15362e3c704fddbb221e66cd9da30a18292a4b84c35

See more details on using hashes here.

File details

Details for the file rulelist-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: rulelist-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 53.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for rulelist-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7c424064d2551817036cd73bdfc5f594a3ed8c7613f2138f8936bf9f296649b4
MD5 d853a9b7721377119e3b55b3b4352202
BLAKE2b-256 cd2911c1740a47da4cb2994a692bb8f3b7c5b0080695756b6074f3a44ed39adb

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