Explainable AI · Data Visualization · Conversational UI · Working Prototype

explainable ai explorer

Before a product relies on an AI prediction, someone who isn’t an ML engineer usually has to decide whether to trust it: a product owner, a domain expert, a reviewer. They need to understand why the model said what it said, without reading the model itself.

In products, explainable AI often means citations or reasoning steps in a chat. This project works a layer below that: explaining the prediction a model made.

I built a working explorer for that person. It runs on the Titanic dataset because the data is familiar and nothing real is at stake. The questions are the ones that matter in healthcare, lending, or insurance: why this prediction, is it consistent, and how do the models differ?

Core idea

An explanation shouldn’t just tell people why a model made a prediction. It should give them ways to inspect, compare, and question its behavior.

Explainable AI Explorer on a dark background: a decision tree tracing the survival path for a 30-year-old female passenger, SHAP waterfall charts for two models beneath it, and a cohort chat panel down the right side

One passenger’s prediction, explained by two models, with a cohort-focused chat alongside.

Interactive prototype · Live demo huggingface.co/spaces/bigpixel/titanic ↗

Runs the actual models on Hugging Face Spaces, so the first load is slow while it starts up. Built with React, D3.js, FastAPI, scikit-learn, XGBoost, SHAP, and Claude Code.

Interpretable vs. explainable

Why the explorer shows two models

The explorer runs two models on the same passenger. They represent two different approaches to explainable AI.

A decision tree is interpretable: its rules are the model, so you can read exactly how it reached a prediction. XGBoost is explainable: it’s too complex to read directly, so a separate technique, SHAP, estimates how much each factor pushed the prediction up or down.

Showing them side by side creates a useful comparison. If two models produce similar results, what would someone need to see to understand how differently they reached them?

For a product owner or domain expert, that difference matters. Model choice isn’t only an accuracy question. It also depends on who needs to understand, check, and defend the result.

The Explainable AI Explorer comparing a decision-tree prediction with an XGBoost prediction for the same passenger
The same passenger, predicted by an interpretable model and an explainable one.
Two explanations, one reading

Reducing the translation between views

A tree and a SHAP chart describe a prediction in fundamentally different ways. The tree shows a sequence of rules. SHAP shows how much each factor contributed. Showing both creates another problem: people have to mentally translate between two different visual structures.

I designed the views as a coordinated explanation instead.

In the tree, the passenger’s path is highlighted while the other branches stay visible, showing both where this passenger went and where a different passenger could have gone.

The SHAP waterfall starts from the average prediction and adds each factor’s push, up or down, until it reaches this passenger’s result.

To make the two views read as one, highlighting a factor in one highlights it in the other, and both read left to right, from starting point to outcome.

Coordinated decision-tree and SHAP explanations for a passenger, with matching factors highlighted in both views
Coordinated highlighting links the passenger’s decision-tree path to the SHAP explanation.
From one passenger to a pattern

Is this prediction part of a pattern?

Explaining one prediction still leaves an important question unanswered: does the same behavior hold across similar cases?

I used the tree itself as one entry point for answering that question. Selecting a leaf creates a cohort from every passenger who reached that leaf through the same path, turning the explanation into a way to explore the underlying population. Cohorts can also be defined directly by editing passenger characteristics, making it possible to compare specific groups.

The cohort makes it possible to see whether the selected prediction is typical of similar cases or an outlier.

The Explainable AI Explorer comparing two selected passenger cohorts defined from decision-tree leaves
Selecting a leaf turns one passenger’s path into a group to compare against.

Cohorts let people inspect similar cases. The what-if tool lets them probe the model directly: change one attribute and see whether the prediction—and its explanation—changes.

Because the models are actually running behind the interface, every change produces a new prediction and a new explanation. The prototype therefore supports experimentation rather than showing a fixed set of examples.

The Explainable AI Explorer what-if tool comparing two passenger scenarios and their predictions
Change one detail and see how each model responds.
Conversational UI

Setting the scope without closing the conversation

The explorer includes a chat for asking about passenger cohorts, with suggested questions such as “Compare women vs men” and “Children in 3rd class.” The suggestions show the kinds of questions the system is designed to answer, while the open field still lets people ask about other passenger groups.

I used the title, suggested prompts, and input text to establish the scope of the conversation rather than presenting a generic “Ask anything” interface. The goal was to make the system’s capabilities visible without limiting people to a fixed set of prompts.

A separate tutorial provides a more guided experience. It walks through a prediction one factor at a time, while the corresponding tree nodes and SHAP bars highlight. People can move through the explanation step by step or leave the tutorial and explore on their own.

Guided tutorial in the chat panel highlighting the sex and pclass nodes in the decision tree and the corresponding SHAP bars, with step-by-step chat prompts walking through a 30-year-old female in 1st class
Each chat step highlights the matching tree nodes and SHAP bars.

Visualization provides the evidence; conversation helps people navigate it.

The Explainable AI Explorer with its chat panel open on the right, showing saved cohort cards for an 8-year-old female in 1st class and a 30-year-old male in 1st class, alongside the decision tree and SHAP views
Saved cohorts in the chat panel, next to the views they came from.