create_indicator_matrix: Create Censoring Indicator Matrix

View source: R/data_preparation.R

create_indicator_matrixR Documentation

Create Censoring Indicator Matrix

Description

Converts NA entries in a longitudinal label matrix (as produced by create_longitudinal_labels) into a binary indicator matrix. This indicator is used by orthoMTL to mask censored observations in the loss computation.

Usage

create_indicator_matrix(Y)

Arguments

Y

A numeric matrix of dimensions n x numTasks, typically produced by create_longitudinal_labels. May contain NA values for censored observations.

Value

A numeric matrix of the same dimensions as Y. 1 = label is observed (known), 0 = label is censored (unknown).

See Also

create_longitudinal_labels

Examples

set.seed(42)
SurvTime <- rexp(10, rate = 0.1)
Event <- rbinom(10, 1, 0.7)
Y <- create_longitudinal_labels(SurvTime, Event, c(4, 6, 10))
W <- create_indicator_matrix(Y)
W   # 1 = observed, 0 = censored

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