Applicant (current point) Counterfactual search path Decision boundary (P = 0.5)
⚠ Couldn't load the 3D engineThree.js failed to load from the CDN. Check your connection and reload.

AI Explainability: Counterfactual Recourse

Explainable AI is not only about showing why a model made a decision — it is often more useful to show what would need to change to get a different one. This simulator renders a small logistic-regression classifier's decision surface in 3D, lets you place an applicant point anywhere in feature space and read a live gradient-based feature-attribution breakdown, then runs a real counterfactual search: gradient descent on a distance-penalized objective that finds the smallest input change needed to flip the model's decision, animated as a path climbing the probability surface toward the boundary. A sparsity weight controls how strongly the search favors a small, actionable change over simply maximizing confidence, and a "new model" control reshapes the whole decision surface to show the explanation adapting to a different classifier.