Skip to content

Individual Conditional Expectation Audit AI

Anaconda Protocol edited this page Jul 1, 2026 · 1 revision

✅ Individual Conditional Expectation (ICE) – Detailed Explanation

What is Individual Conditional Expectation (ICE)?

Individual Conditional Expectation (ICE) is an advanced Explainable AI technique that shows how a specific feature affects the prediction for each individual instance, rather than showing only the average effect.

It was introduced by Goldstein et al. in 2015 as an improvement over Partial Dependence Plots (PDP).

Key Difference: PDP vs ICE

Aspect Partial Dependence Plot (PDP) Individual Conditional Expectation (ICE)
Scope Global average effect Individual effect for each data point
Shows One average line Many lines (one per instance)
Can reveal Overall trend Heterogeneity & interactions
Risk of hiding patterns High (averaging can mask differences) Low (shows variation between individuals)

How ICE Works

  1. For each individual data point, fix all other features at their actual values.
  2. Vary the feature of interest across a range (e.g., age from 18 to 60).
  3. Record how the model’s prediction changes for that specific instance.
  4. Plot one line per instance.

The result is a bundle of lines that show how different individuals respond to changes in that feature.

Python Code Example

# =============================================
# Individual Conditional Expectation (ICE) Example
# =============================================

import pandas as pd
import matplotlib.pyplot as plt
from sklearn.ensemble import RandomForestClassifier
from sklearn.inspection import PartialDependenceDisplay

# Sample Threat Scoring dataset
data = pd.DataFrame({
    'age': [28, 34, 19, 45, 22, 31, 27, 40],
    'in_hotspot_area': [1, 0, 1, 1, 0, 1, 1, 0],
    'night_communication': [1, 0, 1, 1, 0, 1, 1, 0],
    'weapon_detected': [0, 1, 0, 1, 0, 0, 1, 0]
})

target = [1, 1, 0, 1, 0, 1, 1, 0]

model = RandomForestClassifier(n_estimators=100, random_state=42)
model.fit(data, target)

# Generate ICE Plot
fig, ax = plt.subplots(figsize=(10, 6))
PartialDependenceDisplay.from_estimator(
    model,
    data,
    features=['age'],                    # Feature to analyze
    kind='individual',                   # This makes it ICE
    centered=True,                       # Centers lines at 0 for easier comparison
    ax=ax
)

plt.title("Individual Conditional Expectation (ICE) Plot - Effect of Age on Threat Score")
plt.ylabel("Predicted Threat Score")
plt.xlabel("Age")
plt.grid(True)
plt.show()

Interpretation Example

  • If you see many lines rising sharply between ages 18–30 → the model strongly penalizes young males.
  • If lines are very spread out → high heterogeneity (different people react differently to the same feature).
  • Clusters of lines → groups of individuals with similar behavior.

Advantages of ICE

  • Reveals heterogeneity that PDP hides through averaging.
  • Shows interactions and non-linear effects per individual.
  • Very useful for detecting bias patterns across subgroups.
  • More actionable than global averages.

Disadvantages

  • Can become visually cluttered if there are too many instances.
  • Still assumes other features are fixed (does not fully solve multicollinearity).
  • Computationally more expensive than PDP.

Relevance to Israeli Military AI

ICE plots would be extremely powerful for analyzing systems like:

  • Lavender → Showing how different demographic groups (age, location, communication patterns) affect threat scores individually.
  • Threat Scoring in Arbel → Revealing which individuals are most vulnerable to automatic targeting.
  • Gospel → Understanding how building characteristics affect targeting decisions for different types of structures.

This method helps expose systematic discrimination that average-based methods (PDP) might obscure.


Next : more advanced example with multiple features or compare ICE with PDP in more detail?

Clone this wiki locally