Skip to main content

Random Forest counterfactual explanation

Project description

Random forest counterfactuals


The RFC is a library specialised to be use in the domain of Explainable Artificial Intelligence (XAI).

It allows to search for an explanation for pretrained Random Forest Classifier model (from scikit-learn library) in the form of counterfactual examples.

The library also allow to specify constraints (frozen attribute, monotonnicity) for attributes in the specified dataset.

An algorithm is an extended version of Gabriele Tolomei et al. algorithm (link to github).

An extended version has:

  • multiclass classification problem's explainability,

  • gives new methods of selecting counterfactual examples,

  • provides new distance functions (specially HOEM)

  • it is optimized to provide explanation as fast as possible with multiprocessing calculation

This work is done for purpose of my master's thesis.

Installation

This package was tested only on Windows platform. However it should work on Linux platform as well.

To install package:

pip install rf_counterfactuals

Manual installation (for developers)

To build up a pywheel file:

python setup.py bdist_whee

Example

Project details


Download files

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

Source Distribution

rf_counterfactuals-0.1.0.tar.gz (20.0 kB view hashes)

Uploaded Source

Built Distribution

rf_counterfactuals-0.1.0-py3-none-any.whl (21.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page