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            # normal install
pip install --upgrade focus  # or update if needed
conda install -c conda-forge focus

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.dev0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: focus-cfe-0.0.dev0.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.dev0.tar.gz
Algorithm Hash digest
SHA256 e775855e9efc69afb8e821d9b66c6d39f1551c6af7bfbdf7880fe0357db108dc
MD5 04ae806ef29e28f387c43d974c091491
BLAKE2b-256 eba94c49cd7cae366a43cae39dca799d828a515f876f02e0ad11613d24b08592

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for focus_cfe-0.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 760bd6b9d40e3fc3fd5da7123adcf51b81d4f5855dcc5b388502e789eb22be86
MD5 150071159dbbf51fdf2c60bc7c7a7d30
BLAKE2b-256 934860b5e373263ab4d7905d62153dbbc512696a9b5fe9c25e74e277c92d8dae

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