Conformal Quantile Regression (CQR) & Distribution-Free UQ Engine

Pretrained weights and distribution-free calibration inference engine implementing Conformalized Quantile Regression (CQR) and locally-adaptive conformal prediction sets with proven finite-sample marginal coverage guarantees (Romano et al., Angelopoulos & Bates).

Mathematical Formulation

For any confidence level $1 - \alpha \in (0, 1)$, CQR constructs distribution-free prediction intervals: P(Yn+1∈C^(Xn+1))β‰₯1βˆ’Ξ±\mathbb{P}\left(Y_{n+1} \in \hat{C}(X_{n+1})\right) \ge 1 - \alpha

Calibration Mechanics

  1. Multi-Quantile Neural Prediction: $$\hat{q}{\alpha/2}(x), \quad \hat{\mu}(x), \quad \hat{q}{1-\alpha/2}(x), \quad \hat{\sigma}(x)$$
  2. Signed Excess Non-Conformity Scores: $$s_i = \max\left(\hat{q}{\alpha/2}(x_i) - y_i, \ y_i - \hat{q}{1-\alpha/2}(x_i)\right)$$
  3. Discrete Finite-Sample Quantile Index: $$\hat{q} = \text{Quantile}\left(\frac{\lceil(n+1)(1-\alpha)\rceil}{n}; \ {s_1, \dots, s_n}\right)$$
  4. Calibrated Prediction Bands: $$\hat{C}(x) = \left[ \hat{q}{\alpha/2}(x) - \hat{q}, \ \hat{q}{1-\alpha/2}(x) + \hat{q} \right]$$

Features & Guarantees

  • Distribution-Free: Holds exactly regardless of whether underlying noise is Gaussian, multimodal, heavy-tailed, or heteroscedastic.
  • Locally Adaptive: Automatically expands prediction bands in high-variance feature regions and tightens bands in low-noise regions.
  • Microsecond Latency: Calibration in $4.05\text{ ms}$ ($N=300$) and inference in $1.07\text{ ms}$ for $1,000$ points.

Architecture Specifications

Hyperparameter Value Description
Input Features $d_{\text{in}}$ 16 Multi-dimensional tabular / embedding features
Hidden Units $d_{\text{hidden}}$ 64 Shared representation backbone
Quantile Outputs 3 Lower quantile $\hat{q}{\alpha/2}$, median $\hat{\mu}$, upper quantile $\hat{q}{1-\alpha/2}$
Dispersion Head 1 Log-variance $\log \hat{\sigma}^2$ output
Default Coverage Target 90% Nominal $\alpha = 0.10$
Weights Format model.safetensors Native zero-copy binary format (22.7 KB)

Quickstart

import json
import numpy as np
from safetensors.numpy import load_file
from cqr_model import ConformalQuantileNetwork, ConformalCalibrator

# Load model weights
tensors = load_file("model.safetensors")
with open("config.json", "r") as f:
    config = json.load(f)

net = ConformalQuantileNetwork(tensors, config)
calibrator = ConformalCalibrator(net, alpha=0.10, method="cqr")

# Calibrate on n=300 validation samples
x_cal = np.random.randn(300, 16).astype(np.float32)
y_cal = np.random.randn(300)
q_hat = calibrator.calibrate(x_cal, y_cal)

# Predict guaranteed intervals on test points
x_test = np.random.randn(10, 16).astype(np.float32)
c_low, c_high = calibrator.predict_intervals(x_test)
print(f"Calibrated threshold: {q_hat:.4f}")
print("Interval bounds shape:", c_low.shape, c_high.shape)

Attribution & Links

Downloads last month
37
Safetensors
Model size
5.51k params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including At1uri/conformal-quantile-regression-engine

Evaluation results

  • Empirical Coverage (Nominal 90%) on conformal-prediction-coverage-benchmarks
    self-reported
    0.897