Machine learning models increasingly decide who gets a loan, which patients warrant closer monitoring, and how risky an insurance applicant appears. When such a model refuses someone, the person usually wants to know what would have to change for the decision to flip. Counterfactual explanations answer exactly that question: given an input and its prediction, they specify the minimal changes to feature values needed to obtain a different, typically more favorable, outcome. A new study published in Data Mining and Knowledge Discovery extends a method called PPCEF so that this kind of explanation works not only for classification of purely numerical data, where it originated, but also for regression targets and for the mixed numerical-and-categorical tables that dominate real-world applications.
PPCEF, short for Probabilistically Plausible Counterfactual Explanations using Normalizing Flows, was introduced by the same research group in an earlier conference paper for differentiable classifiers on numerical tabular data. The new article, authored by Oleksii Furman, Łukasz Lenkiewicz, Jerzy Stefanowski, Patryk Wielopolski and Maciej Zięba, broadens the framework in three directions. First, it adapts the validity objective to regression, so counterfactuals can target continuous outcomes while still satisfying a density-based plausibility condition. Second, it supports heterogeneous tabular data through dequantization, Gumbel-Softmax relaxation, and post-optimization quantization of categorical features. Third, it adds optional actionability constraints for immutable and monotonic features, so an explanation never suggests changing a person’s race, gender, or other protected attributes.
The core idea behind the method is a tension familiar to anyone who has inspected machine-generated explanations. A counterfactual can be valid, meaning the model actually changes its decision, yet still be useless if it describes a combination of features that no real person or object could have. Plausibility addresses this: following Guidotti’s framing, a counterfactual is plausible when its feature values are coherent with those present in the original data and it sits in a sufficiently dense region of instances from the target class. Earlier work often checked plausibility with simple nearest-neighbor analysis, or modeled the conditional density of the target class and demanded a counterfactual whose density exceeded a threshold. Those density-based approaches, however, typically relied on kernel density estimators or Gaussian mixtures that struggle with multi-dimensional data, and they formulated the search as a constrained optimization problem with strict convexity assumptions.
PPCEF’s key move is to turn that constrained problem into an unconstrained one. Instead of hard constraints, the method optimizes a distance to the original instance plus a weighted sum of a validity loss and a plausibility loss. The plausibility loss penalizes any candidate whose conditional density under the desired outcome falls below a threshold, which is set to the median of the training-sample densities. Crucially, the density itself is estimated by a conditional Normalizing Flow, a generative model that transforms a simple latent distribution into the data distribution through a sequence of invertible functions, allowing exact log-likelihood computation via the change-of-variables formula. Because the framework imposes no prior constraints on the density model, it can use expressive estimators capable of capturing complex, multi-dimensional distributions, unlike the Gaussian-mixture approximation of the closest prior method by Artelt and Hammer.
The regression extension required rethinking what validity means. In classification, a counterfactual is valid when the model’s predicted probability for the desired class clears a margin. In regression, the goal is reaching a specific continuous target value, such as a credit score or a predicted disease risk level. The authors introduce a tolerance-aware validity loss: the squared difference between the desired target and the model’s prediction is penalized only when it exceeds a tolerance threshold, set in the experiments to 0.01 times the target range of each dataset. The conditional plausibility estimation is adapted to continuous targets by binning target values into quintiles when training the density flow, while keeping the continuous optimization objective for counterfactual generation. The authors note that regression counterfactuals have received very limited attention, and that combining continuous targets with plausibility requirements had not been considered in the literature before.
Mixed data posed a different obstacle. Normalizing Flows are designed for continuous distributions and cannot directly model discrete categorical features; applying them naively can produce density models that place arbitrarily high likelihood on a few particular values. The extended framework therefore decomposes each instance into continuous and one-hot encoded categorical components, then dequantizes the categorical part by adding sigmoid-shaped Gaussian noise, normalizing by category count, and applying a logit transformation to map the discrete values into an unconstrained continuous space. During optimization, the plausibility loss sees the dequantized features directly, while the validity loss passes logit-transformed categorical features through a Gumbel-Softmax relaxation, a differentiable approximation that lets gradient-based search operate while samples converge toward valid discrete categories. A temperature parameter is annealed linearly during optimization, starting high enough to explore and ending low enough to yield near-discrete one-hot vectors. After convergence, a post-optimization quantization step recovers discrete category values, preserving categorical semantics.
The actionability extension uses gradient masking. For immutable features, gradients are set to zero so those dimensions never change during optimization, and every immutable component is additionally restored to its factual value after post-processing to prevent mixed-data reconstruction from altering it. For monotonic features that may only move in one direction, such as education level, directional masking permits updates only along the allowed direction. The authors are careful to distinguish this from fairness auditing: treating protected attributes as immutable serves actionable recourse, whereas a fairness test would vary those attributes, ideally through interventions defined by a causal model, to see whether predictions change. PPCEF can support such sensitivity analysis by omitting the immutability mask, but a systematic fairness evaluation remains outside the scope of the work.
Empirically, the article evaluates the new extensions on five mixed-type classification datasets, including Lending Club, Give Me Some Credit, Bank Marketing, Credit Default and Adult, and five regression datasets: a synthetic two-dimensional problem, Concrete Compressive Strength, Diabetes, Yacht Hydrodynamics and the multi-target SCM20D. The predictors span linear and non-linear families, namely Logistic Regression, Multilayer Perceptrons and Neural Oblivious Decision Ensembles for classification, and Linear Regression and Multilayer Perceptrons for regression. Baselines include the density-based method of Artelt and Hammer, the foundational Wachter formulation, case-based and prototype-guided explainers, and, for mixed data, C-CHVAE and DiCE, the two established methods that natively handle categorical features. For regression, the comparison covers the Wachter adaptation and CEARM, a Bayesian-optimization approach by Spooner and colleagues designed specifically for arbitrary regression models.
Across the added settings, PPCEF generally achieves high validity and probabilistic plausibility. On mixed-type data it attains perfect coverage and excellent validity on nearly all datasets and classifiers, consistently outperforming DiCE on plausibility, while C-CHVAE shows stronger plausibility on some datasets such as Bank Marketing and Adult Census, a trade-off the authors acknowledge. Baseline methods often produce counterfactuals with smaller Hamming, L1 and L2 distances, reflecting an inherent tension: satisfying strict validity and plausibility constraints may require larger modifications. In the regression experiments, PPCEF reaches probabilistic plausibility scores near or at 1.00 across all datasets and models, with mean absolute errors close to 0.01, while CEARM and the Wachter baseline exhibit low to near-zero plausibility and generate counterfactuals that outlier metrics flag as anomalies. On the complex multi-target SCM20D dataset, where CEARM is not applicable, PPCEF still delivers precise targets. The higher computational time relative to the Wachter baseline is, in the authors’ view, justified by the gains in plausibility and validity.
New sensitivity analyses probe the method’s knobs. A regression-focused study of the regularization hyperparameter shows that increasing it substantially raises plausibility, with a value of 100 sufficient to approach perfect plausibility on all five regression datasets, at a slight cost in proximity. A density-threshold analysis on the Moons, Law and Audit datasets confirms the expected trade-off: stricter thresholds raise the log density of generated counterfactuals but increase distances, and on the higher-dimensional Audit dataset validity actually improves up to the median threshold before degrading sharply beyond it, indicating a genuine conflict between classifier and density constraints rather than under-optimization. The authors conclude that the median threshold is a sound default. They also report that the immutable-feature mechanism produced zero violations across 5,641 Adult Census and 3,335 Credit Default explanations, though Credit Default showed a larger validity reduction than Adult Census under the constraints. The code is publicly available, and the authors position the extended PPCEF as a practical tool for model debugging and decision support wherever explanations must be both actionable and statistically believable.
Subject of Research: Counterfactual explanation methods for machine learning models on regression and heterogeneous tabular data
Article Title: Extending PPCEF: probabilistically plausible counterfactual explanations for regression and heterogeneous tabular data
Article References: Furman, O., Lenkiewicz, Ł. U., Stefanowski, J., Wielopolski, P., & Zięba, M. (2026). Extending PPCEF: probabilistically plausible counterfactual explanations for regression and heterogeneous tabular data. Data Mining and Knowledge Discovery, 40(6), Article 120. https://doi.org/10.1007/s10618-026-01286-9
Image Credits: AI Generated
DOI: 10.1007/s10618-026-01286-9
Keywords: counterfactual explanations, explainable AI, PPCEF, Normalizing Flows, regression, tabular data, plausibility, Gumbel-Softmax, actionability constraints, machine learning interpretability, Extending, probabilistically
News Source: Denise Maddox. (November 5, 2026). AI explanations that stay realistic: PPCEF method now handles regression and mixed tabular data. Scienmag.



