Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Data Science
  3. anchor

anchor

BSD-2-ClauseJupyter Notebook

A model-agnostic method for generating high-precision rule-based explanations for black-box classifier predictions.

GitHubGitHub
813 stars112 forks0 contributors

What is anchor?

Anchor is a Python library for generating high-precision, rule-based explanations for predictions made by black-box machine learning classifiers. It helps users understand why a model made a specific decision by identifying a minimal set of input features that 'anchor' the prediction, ensuring that changes to other features do not alter the outcome. This method is model-agnostic, meaning it works with any classifier that provides predictions, such as deep neural networks or ensemble models.

Target Audience

Data scientists, machine learning engineers, and researchers who need to interpret, debug, or audit black-box models, particularly in domains requiring transparency like healthcare, finance, or legal applications.

Value Proposition

Developers choose Anchor for its ability to provide precise, interpretable local explanations without requiring access to the model's internals, its support for text and tabular data, and its foundation in peer-reviewed research, ensuring reliability and academic rigor.

Overview

Code for "High-Precision Model-Agnostic Explanations" paper

Use Cases

Best For

  • Explaining individual predictions from black-box text classifiers
  • Auditing model fairness and bias in tabular data applications
  • Debugging misclassifications in complex machine learning models
  • Building trust in AI systems by providing interpretable explanations
  • Research in explainable AI (XAI) and model interpretability
  • Validating model decisions in regulated industries like finance or healthcare

Not Ideal For

  • Real-time applications requiring instant explanation generation, as perturbation-based methods are computationally intensive and slow.
  • Projects focused on image data, since native support for images is not fully implemented and depends on community interest.
  • Teams needing global model explanations to understand overall behavior, as Anchor is designed exclusively for local, instance-specific insights.

Pros & Cons

Pros

Model-Agnostic Flexibility

Works with any black-box classifier that outputs predictions, regardless of internal architecture, making it versatile for various ML models without needing access to internals.

High-Precision Rule Generation

Produces if-then rules (anchors) that guarantee, with high probability, that the prediction remains unchanged when the rule holds, ensuring faithful explanations as per the research paper.

Dual Data Type Support

Currently supports explaining predictions for text classifiers and tabular data (numpy arrays), covering common use cases in machine learning, as stated in the README.

Easy Installation and Setup

Available on PyPI via 'pip install anchor-exp', with clear instructions for additional dependencies like spaCy for text, simplifying initial deployment.

Cons

Limited Image Support

The README notes that image support is contingent on community interest, meaning it's not readily available for computer vision tasks without custom implementation.

Additional Dependencies for Text

Requires installing spaCy and optionally BERT for text explanations, which adds complexity and potential setup hurdles, as mentioned in the installation steps.

Computational Overhead

Perturbation-based explanation generation can be slow for large inputs or complex models, impacting performance in time-sensitive applications due to the method's inherent resource intensity.

Frequently Asked Questions

Quick Stats

Stars813
Forks112
Contributors0
Open Issues26
Last commit4 years ago
CreatedSince 2018

Tags

#python-library#text-classification#xai#interpretable-ai#model-explainability#tabular-data#machine-learning

Built With

t
transformers
s
spaCy
P
Python
N
NumPy
P
PyTorch

Included in

Data Science3.4k
Auto-fetched 1 day ago

Related Projects

shapshap

A game theoretic approach to explain the output of any machine learning model.

Stars25,565
Forks3,731
Last commit2 days ago
LimeLime

Lime: Explaining the predictions of any machine learning classifier

Stars12,145
Forks1,849
Last commit1 year ago
tensorboard-pytorchtensorboard-pytorch

tensorboard for pytorch (and chainer, mxnet, numpy, ...)

Stars7,985
Forks854
Last commit2 months ago
InterpretMLInterpretML

Fit interpretable models. Explain blackbox machine learning.

Stars6,882
Forks784
Last commit2 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub