Skip to main content

FOCUS is a python package for generating counterfactual explanations for a tree-based model

Project description

Deployment & Documentation & Stats & License

PyPI version Coverage Status Maintainability

This library is an implementation of FOCUS: Flexible Optimizable Counterfactual Explanations for Tree Ensembles.

FOCUS generates optimal distance counterfactual explanations to the original data for all the instances in tree‐based machine learning models.

FOCUS counterfactual explanation generation with 3 Lines of Code:

from focus import Focus
# Initialize Focus instance with default values
focus = Focus()
# Generate counterfactual explanations for given tree model and features
pertubed = focus.generate(tree_model, X)

Installation

It is recommended to use pip or conda for installation. Please make sure the latest version is installed:

pip install focus-cfe            # normal install
pip install --upgrade focus-cfe  # or update if needed
conda install -c conda-forge focus-cfe

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

focus-cfe-0.0.dev1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

focus_cfe-0.0.dev1-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file focus-cfe-0.0.dev1.tar.gz.

File metadata

  • Download URL: focus-cfe-0.0.dev1.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.3

File hashes

Hashes for focus-cfe-0.0.dev1.tar.gz
Algorithm Hash digest
SHA256 e76433d0c1c3ec30121098e377553502d2cf9cbed2e30855c4752e00b3c7f22e
MD5 3a66678668797433800e0a4119499a7e
BLAKE2b-256 9b12e0745ada36eb0292a7c180544045b47785afcb678ba74ab5ca06ed5a7c73

See more details on using hashes here.

File details

Details for the file focus_cfe-0.0.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for focus_cfe-0.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e1cb424fe745db5d67e2b67c69278e1712d716c3abe187eee2c8da69e0e5850
MD5 56c90e4d8c5cecc70ebba63241cb9375
BLAKE2b-256 ce183f9e4ced14a6487d58cc629e3290025d2aad13fe0b21313378b5afc5a13a

See more details on using hashes here.

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