Censored Metrics¶
Metrics for censored and interval-censored regression outcomes.
Censoring means the target is only partially observed. With true event time \(T_i\), censoring time \(C_i\), observed value \(Y_i = \min(T_i, C_i)\) and indicator \(\delta_i = \mathbb{I}(T_i \le C_i)\), a right-censored sample tells us "\(T_i \ge Y_i\)" rather than "\(T_i = Y_i\)". Scoring such data with ordinary MAE silently treats the censoring bound as the truth. The metrics on this page therefore fall into three groups: censoring-aware summaries (censoring_rate), scores restricted to fully observed samples (observed_mae), and rank-based scores that use the partial order (concordance_index, Harrell's C). For likelihood-based evaluation use the censored losses (CensoredGaussianNLLLoss, AFTLoss); for interval-censored targets pass the lower/upper bounds where the metric supports them.
Available Metrics¶
Censoring Rate¶
Measures the fraction of samples in the dataset that are censored:
where \(c_i \in \{-1, 0, 1\}\) is the censoring indicator (\(0\) for fully observed, \(1\) for right-censored, \(-1\) for left-censored).
Observed MAE¶
Computes the Mean Absolute Error only on the subset of data that is fully observed (not censored):
Concordance Index¶
Measures the ordinal rank agreement between predicted values and censored targets (Harrell's C-index).
A pair of samples \((i, j)\) with observed times \(t_i, t_j\) is comparable if \(t_i < t_j\) and sample \(i\) is fully observed (\(c_i = 0\)). The concordance index is the fraction of comparable pairs where the predicted order matches the observed order, with tied predictions receiving half credit:
where \(|\mathcal{P}|\) is the number of comparable pairs.
Interval Overlap Rate¶
Measures the fraction of samples where a predicted interval \([\hat{L}_i, \hat{U}_i]\) overlaps with a censor-interval \([L_i, U_i]\):
Usage¶
import torch
import torchregress as tr
pred = torch.tensor([0.5, 1.0, 1.5, 2.0])
target = torch.tensor([0.4, 1.2, 1.3, 2.1])
censoring = torch.tensor([0, 1, 0, -1])
c_rate = tr.metrics.censoring_rate(censoring)
mae_obs = tr.metrics.observed_mae(pred, target, censoring)
c_index = tr.metrics.concordance_index(pred, target, censoring)
See the censored metrics API: censoring_rate, observed_mae, concordance_index, and interval_overlap_rate.
Limitations¶
- Censoring Rate is not a quality metric: A high censoring rate indicates data sparsity but does not directly measure model performance. Always pair with observed MAE and concordance index.
- Concordance Index is rank-based only: C-index measures whether predictions preserve the correct order of survival times, but does not assess absolute calibration. Two models with the same C-index can have very different survival-time predictions.
- Observed MAE only evaluates uncensored points: It does not account for censored targets, which may bias the evaluation if censoring is informative (non-random).
- Interval overlap rate assumes bounded intervals: The metric is most interpretable when targets are interval-censored with known bounds; for right-censored targets, the information is weaker.
Recommendations¶
- Report multiple censored metrics together: Observed MAE + Concordance Index + Censoring Rate gives a balanced view of accuracy, ranking, and data missingness.
- Use Kaplan–Meier or AFT-based evaluation alongside point metrics for survival settings where the full time-to-event distribution matters.
- Stratify evaluation by censoring type (right, left, interval) when the dataset contains mixed censoring patterns.
Next steps¶
- Ordinal metrics — related evaluation for ordered-class outcomes
- Point metrics — observed MAE pairs naturally with standard point accuracy on uncensored subsets
- Censored losses — censored Gaussian NLL, quantile, and AFT losses for training
- Censored regression example — full comparison of censored methods
References¶
| # | Reference |
|---|---|
| 1 | F.E. Harrell, R.M. Califf, D.B. Pryor, K.L. Lee, R.A. Rosati. "Evaluating the Yield of Medical Tests." JAMA, 247(18):2543–2546, 1982. |
| 2 | J. Tobin. "Estimation of Relationships for Limited Dependent Variables." Econometrica, 26(1):24–36, 1958. |