Giter Club home page Giter Club logo

rulediscovery's Introduction

Rule Generation for Classification: Scalability, Interpretability, and Fairness

Adia Lumadjeng, Tabea Röber, M. Hakan Akyüz, and Ş. Ilker Birbil

We introduce a new rule-based optimization method for classification with constraints. The proposed method takes advantage of linear programming and column generation, and hence, is scalable to large datasets. Moreover, the method returns a set of rules along with their optimal weights indicating the importance of each rule for learning. Through assigning cost coefficients to the rules and introducing additional constraints, we show that one can also consider inter pretability and fairness of the results. We test the performance of the proposed method on a collection of datasets and present two case studies to elaborate its different aspects. Our results show that a good compromise between interpretability and fairness on the one side, and accuracy on the other side, can be obtained by the proposed rule-based learning method.

You can find the details in our manuscript.

This notebook illustrates how to use RUX and RUG.

Installation

  1. Install Anaconda Distribution.

  2. Create a new environment and install the necessary packages:

conda create -n rulediscovery -c conda-forge numpy pandas scikit-learn cvxpy cvxopt

  1. Activate the current environment and install gurobi package in the environment:

conda activate rulediscovery

conda install -c gurobi gurobi

Repo structure

The code contains the following files to reproduce the results of our manuscript:

  1. In the jupyter notebook RuleDiscovery.ipynb we demonstrate how to use RUG and RUX in single fold on the ecoli dataset. The code will produce the results of RF, ADA and GB, along with RUX(RF), RUX(ADA), RUX(GB), and RUG.

  2. The folder num_exp contains all files for the numerical experiments and the case study reported in the manuscript. Please see the README.md in that directory for more details.

Solvers

Note that the default for solver option is 'gurobi'. To use the Gurobi solver, you need to first install it. The solver is freely available for academic use. Check the related page on Gurobi's website. The current version of our code also supports the open source solver GLPK (set solver='glpk').

rulediscovery's People

Contributors

sibirbil avatar tabearoeber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

adialumadjeng

rulediscovery's Issues

ruxg.py line 413

Issue:
The line self.ruleLengthPerSample = np.mean(rule_lengths) assigns the mean value of rule_lengths to the entire array self.ruleLengthPerSample. However, the intention seems to assign this mean value to a specific index within self.ruleLengthPerSample.

Proposed Correction:
self.ruleLengthPerSample[sindx] = np.mean(rule_lengths). This change ensures the mean value is placed at the intended index within the array

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.