Tutorial on using Conformal Predictive Systems in KNIME

Tuwe Löfström, Alexander Bondaletov, Artem Ryasik, Henrik Boström, Ulf JohanssonCOPA 2023

Introduction

This paper introduces a new extension for the KNIME Analytics Platform that implements Conformal Predictive Systems (CPS). By moving beyond simple point predictions to full, mathematically valid probability distributions, this tool allows low-code users to quantify uncertainty, generate flexible confidence intervals, and calculate the probability of specific outcomes with high reliability.

The Problem: Beyond Point Predictions

Standard machine learning models typically provide "point predictions"—a single best guess for a target value. However, in high-stakes fields like medicine or finance, knowing how sure a model is matters as much as the prediction itself.

While Conformal Prediction (CP) has previously been available in KNIME to provide "prediction intervals" (e.g., "the price is between $10 and $20 with 95% confidence"), it has limitations. Standard CP regression uses absolute errors, meaning it cannot distinguish if a value is more likely to be at the top or bottom of that range. Furthermore, most advanced conformal tools require significant coding expertise in Python or R, creating a barrier for domain experts who prefer visual workflow tools like KNIME.

Methodology: Implementing Inductive CPS

The authors implement Inductive Conformal Predictive Systems as a set of new KNIME nodes. The core technical shift from standard CP to CPS is the use of signed errors (actual residuals) rather than absolute errors.

CDF Generation

Instead of a fixed interval, CPS produces a full Cumulative Distribution Function (CDF) for every test instance. This allows users to query the model for any significance level or specific threshold.

A CPS-generated CDF showing how different confidence intervals (one-sided and two-sided) can be derived from a single distribution.

Normalization and Mondrian CPS

The system can use a "difficulty estimate" (like prediction variance from a Random Forest) to stretch or shrink the distribution based on how hard a specific instance is to predict. To handle heteroscedasticity (where error patterns change across different parts of the data), the authors demonstrate a "Mondrian" approach. This involves binning data—for example, by predicted value—and applying the conformal logic within those bins to ensure local validity.

Experimental Setup

The implementation was evaluated using 23 benchmarking datasets commonly used in regression literature, including Abalone, Concrete, and Housing, as well as various versions of the Bank, Kinematics (Kin8), and Robot Arm (Puma8) datasets. All target variables were Min-Max normalized to a [0, 1] range to allow for direct comparison of "efficiency" (interval tightness) across different problems.

Key Insights

  • From Intervals to Distributions: A single model run provides a wealth of information. Users can determine the 90% confidence interval, but also the specific probability that a value exceeds a certain threshold (e.g., 0.5).
  • Low-Code Accessibility: By integrating these complex statistical frameworks into KNIME's node-based interface, the authors enable "visual programming" of uncertainty. Users can build Mondrian systems using standard loop and binning nodes without writing code.
  • The Power of Mondrian Bins: Standard predictive systems can be biased if the underlying model systematically over- or under-estimates certain ranges. Mondrian CPS corrects this bias by looking at the distribution of errors within specific "bins" of predicted values.
Mondrian CPS distributions across four different bins, showing how the system corrects for model bias in different prediction ranges.

Results

  • Validity: Across all 23 datasets, the error rates almost perfectly matched the chosen significance levels ($\epsilon$). If a 95% confidence level was requested, the true value fell outside the predicted range exactly ~5% of the time.
  • Efficiency Gains: The authors compared four setups, finding that Normalized Mondrian CPS consistently produced the "sharpest" (smallest) valid intervals.
  • Quantifiable Tightness: At a 95% confidence level, the intervals typically covered between 25% and 33% of the total target range. Reducing confidence to 80% tightened these intervals to roughly 16% of the range.

Conclusion and Future Work

While this specific update focuses on regression, future work will include supporting Venn and Venn-Abers predictors to bring similar distributional benefits to classification tasks. Although calculating CDFs for every instance in a large dataset can increase execution time, the reliability gains for high-stakes decision-making are substantial. Future updates aim to include "smoothed p-values" and better internal support for Mondrian categories to reduce workflow complexity.

Summary updated

BibTeX
@inproceedings{lofstrom2023tutorial,
  author = {Tuwe Löfström and Alexander Bondaletov and Artem Ryasik and Henrik Boström and Ulf Johansson},
  title = {{Tutorial on using Conformal Predictive Systems in KNIME}},
  booktitle = {COPA},
  year = {2023},
}
Figure