Skip to main content
Pre-release

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

Unified IG

Unified IG provides one small, SHAP-like API for Integrated Gradients across model families. The first implementation supports closed-form attributions for scikit-learn linear models and multilayer perceptrons.

import unifiedig as uig

explainer = uig.Explainer(model, baseline)
explanation = explainer(X)

For numerical backends, the quadrature resolution is configurable:

explainer = uig.Explainer(model, baseline, n_steps=128)

Explanation is lightweight and has SHAP-compatible fields. SHAP remains an optional dependency; call explanation.to_shap() to use its plotting tools.

Installation

During development, install the project and its test dependencies with:

python -m pip install -e ".[test]"

Output semantics

For regression, attributions sum to the difference between the prediction and the baseline prediction. Binary classifiers are explained on their decision-score (logit) scale; probability attributions are not part of V1. See docs/semantics.md for the complete array-shape and output contract.

Numerical explanations expose their observed completeness residual:

explanation.completeness_error
explanation.max_abs_completeness_error

Unified IG warns when this error exceeds the configured tolerance. Increasing n_steps usually improves it. See the examples/ directory for complete linear, logistic, MLP regression, and MLP classification programs.

Supported models

  • sklearn.linear_model.LinearRegression (closed form)
  • Binary sklearn.linear_model.LogisticRegression (closed form)
  • sklearn.neural_network.MLPRegressor (analytic gradients and quadrature)
  • Binary sklearn.neural_network.MLPClassifier (analytic logit gradients and quadrature)

Development

Run the tests and validate distribution artifacts with:

pytest
python -m build
python -m twine check dist/*

See CONTRIBUTING.md for the development workflow.

Download files

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

Source Distribution

unifiedig-0.1.0.dev1.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unifiedig-0.1.0.dev1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file unifiedig-0.1.0.dev1.tar.gz.

File metadata

  • Download URL: unifiedig-0.1.0.dev1.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for unifiedig-0.1.0.dev1.tar.gz
Algorithm Hash digest
SHA256 d35f53a594c6bf70d2dfedbcdbf265a508c85188fb6f2e279884713521fd7186
MD5 62f20eae8bf30b2334450182b499cdf9
BLAKE2b-256 c218b4ec4a903e6038cbb6eae7c658e650afd545d4fc502a1b46166fd29beb4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for unifiedig-0.1.0.dev1.tar.gz:

Publisher: release.yml on LudgerHentschel/unifiedig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file unifiedig-0.1.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: unifiedig-0.1.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for unifiedig-0.1.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 ddbafc91ff77bf041b3caa1247b4a75e750285ca809a96d25effcfb3ab4c4ab8
MD5 637dd72f2d30a8a0931770e9a7d958a4
BLAKE2b-256 9e103522cbaaf98a2a66014cfc6daeff8743be12bd560bf3cfcb8fed8e040027

See more details on using hashes here.

Provenance

The following attestation bundles were made for unifiedig-0.1.0.dev1-py3-none-any.whl:

Publisher: release.yml on LudgerHentschel/unifiedig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.6

2 files

0.1.0

2 files

This release

0.1.0.dev1 This release

2 files

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