Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ibreakdown

https://travis-ci.com/jettify/ibreakdown.svg?branch=master https://codecov.io/gh/jettify/ibreakdown/branch/master/graph/badge.svg https://img.shields.io/pypi/pyversions/ibreakdown.svg https://img.shields.io/pypi/v/ibreakdown.svg

ibreakdown is model agnostic predictions explainer with interactions support, library can show contribution of each feature in your prediction value.

SHAP or LIME consider only local additive feature attributions, when ibreakdown also evaluates local feature interactions.

Algorithm

Algorithm is based on ideas describe in paper “iBreakDown: Uncertainty of Model Explanations for Non-additive Predictive Models” https://arxiv.org/abs/1903.11420 and reference implementation in R (iBreakDown)

Intuition behind algorithm is following:

The algorithm works in a similar spirit as SHAP or Break Down but is not
restricted to additive effects. The intuition is the following:

1. Calculate a single-step additive contribution for each feature.
2. Calculate a single-step contribution for every pair of features. Subtract additive contribution to assess the interaction specific contribution.
3. Order interaction effects and additive effects in a list that is used to determine sequential contributions.

This simple intuition may be generalized into higher order interactions.

In depth explanation can be found in algorithm authors free book: Predictive Models: Explore, Explain, and Debug https://pbiecek.github.io/PM_VEE/iBreakDown.html

Simple example

# model = RandomForestClassifier(...)
explainer = ClassificationExplainer(model)
classes = ['Deceased', 'Survived']
explainer.fit(X_train, columns, classes)
exp = explainer.explain(observation)
exp.print()

Please check full Titanic example here: https://github.com/jettify/ibreakdown/blob/master/examples/titanic.py

+------------------------------------+-----------------+--------------------+--------------------+
| Feature Name                       | Feature Value   |   Contrib:Deceased |   Contrib:Survived |
+------------------------------------+-----------------+--------------------+--------------------|
| intercept                          |                 |          0.613286  |          0.386714  |
| Sex                                | female          |         -0.305838  |          0.305838  |
| Pclass                             | 3               |          0.242448  |         -0.242448  |
| Fare                               | 7.7375          |         -0.119392  |          0.119392  |
| Siblings/Spouses Aboard            | 0               |         -0.0372811 |          0.0372811 |
| ('Age', 'Parents/Children Aboard') | [28.0 0]        |          0.0122196 |         -0.0122196 |
| PREDICTION                         |                 |          0.405443  |          0.594557  |
+------------------------------------+-----------------+--------------------+--------------------+

Features

  • Supports predictions explanations for classification and regression

  • Easy to use API.

  • Works with pandas and numpy

  • Support interactions between features

Installation

Installation process is simple, just:

$ pip install ibreakdown

Requirements

CHANGES

Metadata

Release files for ibreakdown 0.0.1a4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ibreakdown 0.0.1a4
File Size Uploaded
ibreakdown-0.0.1a4.tar.gz 9.2 kB Details

Release files / ibreakdown-0.0.1a4.tar.gz

Download URL ibreakdown-0.0.1a4.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fd3cccd6ade5be548a6f6830c41a08208302461491df05941b444ad2b71b1c88
BLAKE2b-256 checksum
How to use checksums
08396a6cf178790750dc2dd099969de0fed5119e86344b8f04f72109303b7215
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Release history Release notifications | RSS feed

This release

0.0.1a4 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page