[This article was first published on T. Moudiki's Webpage - R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.A few days ago, I presented Conformalized TabPFN: Prediction Intervals for a Pretrained Transformer for Tabular Data in Python and R. Today, it’s about TabICL, another state-of-the-art tabular foundation model. TabICL requires no token, as you’ll notice in the following Python and R code.1 – Python version!pip install tabicl nnetsauce # scikit-learn matplotlib numpyfrom sklearn.datasets import load_diabetesfrom sklearn.model_selection import train_test_splitfrom sklearn.linear_model import RidgeCVfrom sklearn.metrics import mean_squared_errorfrom tabicl import TabICLRegressorimport nnetsauce as nsimport numpy as npimport matplotlib.pyplot as pltfrom time import time# ── data ───────────────────────────────────────────────────X, y = load_diabetes(return_X_y=True)X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=0.2, random_state=42)# ── base models ────────────────────────────────────────────models = { "TabICL": TabICLRegressor(), "RidgeCV": RidgeCV(),}results = {}for name, reg in models.items(): start = time() conf = ns.PredictionInterval(reg, level=95) conf.fit(X_train, y_train) pi = conf.predict(X_test, return_pi=True) print(f"{name:10s} time={time() - start:.1f}s") coverage = np.mean((pi.lower = y_test)) width = np.mean(pi.upper - pi.lower) rmse = np.sqrt(mean_squared_error(y_test, pi.mean)) results[name] = {"pi": pi, "coverage": coverage, "width": width, "rmse": rmse} print(f"{name:10s} RMSE={rmse:.1f} " f"coverage={coverage:.3f} avg_width={width:.1f}")# ── plot side-by-side ──────────────────────────────────────fig, axes = plt.subplots(1, 2, figsize=(12, 4), sharey=True)colors = {"TabICL": "orange", "RidgeCV": "steelblue"}max_idx = 50for ax, (name, res) in zip(axes, results.items()): pi = res["pi"] x = range(max_idx) ax.fill_between(x, pi.lower[:max_idx], pi.upper[:max_idx], alpha=0.35, color=colors[name], label="95% PI") ax.plot(x, pi.mean[:max_idx], "k--", lw=1.5, label="predicted") ax.plot(x, y_test[:max_idx], "k.", ms=6, alpha=0.4, label="observed") ax.set_title( f"{name} | cov={res['coverage']:.3f} width={res['width']:.1f}" ) ax.legend(fontsize=8)plt.suptitle("Conformalized TabICL vs RidgeCV — diabetes dataset")plt.tight_layout()plt.show()Checkpoint 'tabicl-regressor-v2-20260212.ckpt' not cached. Downloading from Hugging Face Hub (jingang/TabICL).tabicl-regressor-v2-20260212.ckpt: 0%| | 0.00/114M [00:00