Code Monkey home page Code Monkey logo

rulecosi's Introduction

Travis

RuleCOSI - Rule extraction COmbination and SImplification from classification tree ensembles

RuleCOSI is a machine learning package that combine and simplifies tree ensembles and generates a single rule-based classifier that is smaller and simpler. It was developed in the Industrial Artificial Intelligence Laboratory (IAI) at Kyung Hee University by (Josue Obregon). The implementation is compatible with scikit-learn.

Installation

Dependencies

rulecosi is tested to work under Python 3.9+. The dependency requirements used when developing the library are:

  • numpy>=1.22.3
  • scipy>=1.8.0
  • scikit-learn>=1.0.2
  • gmpy2>=2.1.2
  • pandas>=1.4.1
  • bitarray>=2.5.1
  • xgboost>=1.5.2 (optional)
  • lightgbm>=3.3.2 (optional)
  • catboost>=1.0.4 (optional)

Installation

From source available on GitHub

Right now it is just available from GitHub. You can clone it and run the setup.py file. Use the following commands to get a copy from Github and install all basic dependencies:

git clone https://github.com/jobregon1212/rulecosi.git
cd rulecosi
pip install .

This installs the basic rulecosi package. It will only work with the following scikit-learn tree ensembles: BaggingClassifier, RandomForestClassifier and GradientBoostingClassifier.

If you want to install the package with support to other ensembles, you have to add the required packages separated by commas inside square brackets when you install rulecosi. For example if you would like to have XGBoost support you have to run the following command:

git clone https://github.com/jobregon1212/rulecosi.git
cd rulecosi
pip install .[xgboost]

The supported optional packages are xgboost, lightgbm and catboost.

Documentation

The python documentation is available in this link.

Development

The development of rulecosi tried to be in line with the one of the scikit-learn community. Therefore, you can refer to their Development Guide.

About

If you use rulecosi in a scientific publication, we would appreciate citations to the following paper:

@article{obregon2022rulecosi+,
title = {RuleCOSI+: Rule extraction for interpreting classification tree ensembles},
journal = {Information Fusion},
volume = {89},
pages = {355-381},
year = {2023},
issn = {1566-2535},
doi = {https://doi.org/10.1016/j.inffus.2022.08.021},
url = {https://www.sciencedirect.com/science/article/pii/S1566253522001129},
author = {Josue Obregon and Jae-Yoon Jung}

}

The algorithm works with different type of ensembles and it uses the implementations provided by the sklearn package. The supported tree ensemble types are:

  1. BaggingClassifier
  2. RandomForestClassifier
  3. GradientBoostingClassifier
  4. XGBClassifier
  5. LGBMClassifier
  6. CatBoostClassifier

For more information you can check the usage in the docstrings or the examples folder of this repository.

References:

[1]Obregon, J., & Jung, J. Y. (2023). RuleCOSI+: Rule extraction for interpreting classification tree ensembles. Information Fusion, 89, 355-381.

rulecosi's People

Contributors

jobregon1212 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Forkers

marioopv

rulecosi's Issues

Difference between pseudocode in the paper and implementation.

I am very glad to see your paper "RuleCOSI+: Rule extraction for interpreting classification tree ensembles".

I am afraid to point out that I don't think the pseudo code in your paper matches the text in the relevant section.

In Procedure 3. GENERALIZERULESET, lines 11 and 12 say "remove the rule" if the condition is satisfied.

However, in the text of Section 3.5.2. Ruleset generalization, it is written as follows

The last step consists of removing the rules that do not comply with the rule accuracy and rule confidence thresholds (see lines 11 and 12).

Which is correct?

Relevant code

Best regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.