Package: rulelist
MDL Rule Lists for prediction and subgroup discovery.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.DependenciesThis project was written for Python 3.7. All required packages from PyPI are specified in therequirements.txt.NOTE:This list of packages includes thegmpy2package.InstallationThe latest release can be installed using pip:pipinstallrulelistIf you run into issues regarding thegmpy2package mentioned above, please refer to their documentation for help.For the current version, you can clone the repository and install the dependencies locally:gitclonehttps://github.com/HMProenca/RuleList.gitcdRuleList
pipinstall-rrequirements.txtExample of usage for prediction:importpandasaspdfromrulelistimportRuleListfromsklearnimportdatasetsfromsklearn.model_selectionimporttrain_test_splittask='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)fromsklearn.metricsimportaccuracy_scoreaccuracy_score(y_test.values,y_pred)print(model)Example of usage for subgroup discovery:importpandasaspdfromrulelist.rulelistimportRuleListfromsklearnimportdatasetstask='discovery'target_model='gaussian'data=datasets.load_boston()y=pd.Series(data.target)X=pd.DataFrame(data.data)model=RuleList(task=task,target_model=target_model)model.fit(X,y)print(model)ContactIf there are any questions or issues, please contact me by mail athugo.manuel.proenca@gmail.comor open an issue here on Github.CitationIn 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}
}and@article{proencca2021robust,
  title={Robust subgroup discovery},
  author={Proen{\c{c}}a, Hugo Manuel and B{\"a}ck, Thomas and van Leeuwen, Matthijs},
  journal={arXiv preprint arXiv:2103.13686},
  year={2021}
}ReferencesInterpretable multiclass classification by MDL-based rule lists. Hugo M. ProenÃ§a, Matthijs van Leeuwen. Information Sciences 512 (2020): 1372-1393.or publicly available inArXiv-- experiments code (old version) availablehereDiscovering outstanding subgroup lists for numeric targets using MDL. Hugo M. ProenÃ§a, Peter GrÃ¼nwald, Thomas BÃ¤ck, Matthijs van Leeuwen. ECML-PKDD(2020):-- experiments code availablehereRobust subgroup discovery. Hugo M. ProenÃ§a,Thomas BÃ¤ck, Matthijs van Leeuwen. (2021)-- experiments code availablehere