You don’t observe \(\alpha_0\) on real data, so the held-out Riesz loss from cross-validation (cross_val_score, or whatever validation signal a backend exposes during fit) is the only training-time signal. After fitting, .diagnose() reports magnitude statistics and warnings about extreme tail values, near-positivity violations, and single-point extrapolation. Those warnings often matter more for downstream variance than the bulk fit quality.
.diagnose() is defined in rieszreg.diagnostics and works for any RieszEstimator subclass. Backend-specific extensions (e.g. KernelDiagnostics adds chosen λ, support size, effective d.o.f., and the kernel matrix’s condition number) layer on top of the shared base.
This page walks through .diagnose() on an under-tuned booster (so the warnings fire) and maps each warning to the hyperparameter that fixes it. See Boosting backend and Kernel backend for the backend-specific tuning recipes.
Setup: a low-overlap dataset
We push the propensity close to 0 in part of the covariate space. This is where naive inverse-propensity weighting falls apart.
Magnitude block. RMS, mean, min/max, and |alpha| quantiles. The 99th percentile and the max are the load-bearing numbers. Healthy fits have max no more than a few times the 99th percentile. Max far above the 99th percentile signals a single-point extrapolation outlier: one leaf is far from any training data and its prediction has run away.
Extreme rows. Rows where \(|\hat\alpha|\) exceeds extreme_threshold (default 30). Downstream IF estimator variance is dominated by the largest few weights, so even 1% of rows over the threshold inflates confidence intervals.
Warnings. Two automatic checks:
“X% of rows have \(|\hat\alpha| >\) threshold — possible near-positivity violation.” Either the data has genuine near-positivity (truncate extreme_threshold and report the loss of overlap), or the estimator is over-fitting (tune as below).
“max \(|\hat\alpha|\) is >10× the 99th percentile — likely a single extrapolation outlier.” The learner found a region with no nearby training data. Tighten model complexity, increase regularization, or stop earlier.
A tuned fit
Same data with sensible hyperparameters and early stopping.
The max \(|\hat\alpha|\) shrinks by an order of magnitude, the extreme-row count drops, and the warnings clear.
What .diagnose() does not do
It does not estimate \(\alpha_0\) for comparison; that closed form is generally unavailable. It does not assess sample size. It checks magnitude and the two failure modes above. For fit quality, track the held-out Riesz loss (best_score_). For downstream confidence intervals, use the bootstrap on the plug-in estimator.