cindex_mtl: Concordance Index for Multi-Task Predictions

View source: R/metrics.R

cindex_mtlR Documentation

Concordance Index for Multi-Task Predictions

Description

Computes a concordance index (C-index) adapted for the multi-task survival framework. Predictions across tasks are aggregated by row-sum to produce a single score per patient, then concordance is evaluated over pairs where at least one member has a fully observed outcome.

Usage

cindex_mtl(true.label.mat, pred.label.mat)

Arguments

true.label.mat

A numeric matrix of true response labels with dimensions n x numTasks. May contain NA for censored observations (as produced by create_longitudinal_labels).

pred.label.mat

A numeric matrix of predicted response values with dimensions n x numTasks (as produced by predict.orthoMTL).

Details

The effective survival time for each patient is derived as the highest task index where the true label is positive (i.e., the last threshold at which the patient was progression-free).

A patient is considered "uncensored" only if all task labels are non-NA. Concordant pairs require both a correct ordering of effective survival times and a matching ordering of predicted scores.

Value

A numeric value between 0 and 1 (higher is better). A value of 0.5 indicates random concordance.

Known limitations

The following limitations are documented and flagged for future investigation:

  • No credit for tied predictions or tied survival times

  • Strict censoring: uncensored requires all tasks observed

  • Equal weighting of all tasks in the row-sum aggregation

See Also

predict.orthoMTL for generating the prediction matrix.

Examples

# Simulate a small multi-task prediction scenario
set.seed(42)
n <- 30; n_tasks <- 4
SurvTime <- rexp(n, rate = 0.1)
Event <- rbinom(n, 1, 0.7)
thresholds <- c(4, 6, 10, 15)

Y <- create_longitudinal_labels(SurvTime, Event, thresholds)

# Simulate imperfect predictions (add noise to true labels)
pred <- Y
pred[is.na(pred)] <- 0.5
pred <- pred + matrix(rnorm(n * n_tasks, sd = 0.3), n, n_tasks)

cindex_mtl(Y, pred)

orthoMTL documentation built on Aug. 23, 2026, 5:10 p.m.