explaingit

zpao/captum

Analysis updated 2026-08-16 · repo last pushed 2019-10-30

1Audience · developerComplexity · 3/5DormantSetup · moderate

TLDR

Captum is a tool for understanding why a machine learning model made a specific prediction. It shows which pieces of input data drove a model's decision and how strongly each feature influenced the outcome.

Mindmap

mindmap
  root((repo))
    What it does
      Explains model predictions
      Assigns attribution scores
      Traces feature influence
      Peeks inside neurons
    Tech stack
      Python
      PyTorch
      Web interface
    Use cases
      Debug biased models
      Explain recommendations
      Compare algorithms
    Audience
      ML developers
      Researchers
    Extras
      Insights web UI
      Still in beta

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Debug a biased model by pinpointing exactly which inputs are causing unexpected decisions.

USE CASE 2

Explain why a recommendation system suggested a specific item based on user features.

USE CASE 3

Compare different interpretability algorithms against each other for research purposes.

USE CASE 4

Interactively explore which features drove a prediction using the Insights web interface.

What is it built with?

PythonPyTorch

How does it compare?

zpao/captum0xallam/posthog0xallam/search-engine
Stars111
LanguagePythonC++
Last pushed2019-10-302026-03-262023-08-23
MaintenanceDormantMaintainedDormant
Setup difficultymoderatemoderatehard
Complexity3/53/53/5
Audiencedeveloperpm founderdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a working PyTorch environment and an existing PyTorch model to analyze.

No license information was provided in the explanation.

In plain English

Captum is a tool that helps you understand why a machine learning model made a specific prediction. When complex models like deep neural networks produce an output, it is often a mystery which pieces of input data actually drove that decision. This library lifts the hood on those models, showing you exactly which features contributed to the result and how strongly they pushed the outcome one way or another. At a high level, the library analyzes your model and assigns "attribution scores" to each piece of input data. A positive score means that specific feature helped drive the prediction, while a negative score means it pushed against it. The larger the number, the stronger the influence. It works by comparing the actual input against a neutral baseline, like an empty or zeroed-out version of the input, and mathematically tracing how the model's output changes as it moves from that baseline to the real data. It can also peek inside the model to show which internal components, or "neurons," are doing the heavy lifting for a given prediction. Machine learning developers and researchers are the primary users. A developer building a movie recommendation system, for instance, could use this to figure out why the system keeps suggesting a specific film, was it the user's past viewing history, the genre, or the actor? If a model starts making unexpected or biased decisions, engineers can use these tools to pinpoint exactly which inputs are causing the problem and fix the underlying logic. Researchers can also use it to test and compare different interpretability algorithms against each other. The project also includes a web-based visualization interface called Insights, which lets users interactively explore these attribution scores. It is worth noting that the library is still in beta and under active development, meaning features are still evolving. It also requires a specific machine learning framework called PyTorch to function, as it was built specifically to work with PyTorch models.

Copy-paste prompts

Prompt 1
How do I use Captum to assign attribution scores to input features in my PyTorch model and understand which features drove its prediction?
Prompt 2
Set up Captum to analyze a movie recommendation model and identify whether user history, genre, or actor data had the strongest influence on a recommendation.
Prompt 3
How do I use Captum Insights to interactively visualize and explore attribution scores for my model predictions?
Prompt 4
Use Captum to compare different interpretability algorithms on my PyTorch model and show which features each algorithm identifies as most influential.

Frequently asked questions

What is captum?

Captum is a tool for understanding why a machine learning model made a specific prediction. It shows which pieces of input data drove a model's decision and how strongly each feature influenced the outcome.

Is captum actively maintained?

Dormant — no commits in 2+ years (last push 2019-10-30).

What license does captum use?

No license information was provided in the explanation.

How hard is captum to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is captum for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.