---
title: 'ROAMM-EHR & SCMTF: EHR Phenotyping'
url: https://www.emergentmind.com/topics/roamm-ehr
type: topic
---

# ROAMM-EHR & SCMTF: EHR Phenotyping

ROAMM-EHR is not directly referenced or defined as a stand-alone term in the arXiv source, but its relevant context, methodologies, and technical workflows are exemplified by the Supervised Coupled Matrix-Tensor Factorization (SCMTF) approach for computational phenotyping of patient-reported outcomes (PROs) within electronic health record (EHR) systems, as applied to ulcerative colitis (UC) data [2506.20065]. The following sections detail the foundation, mathematical formalism, missing data handling, optimization, and the interpretability and significance of SCMTF-based approaches in EHR-driven clinical phenotyping.

## 1. Foundational Principles: Multi-Modal and Heterogeneous Data in EHR

SCMTF addresses computational phenotyping by distinguishing latent patient phenotypes through joint factorization of multi-modal, heterogeneous, and highly incomplete EHR-derived data. This paradigm incorporates both time-varying and static patient variables. Traditionally, patient-reported outcomes (PROs)—subjective, noisy, and overwhelmingly sparse—are routinely excluded from EHR-based machine learning pipelines due to their incomplete availability. SCMTF challenges this exclusion, leveraging deep low-rank matrix and tensor models to incorporate temporal PROs, laboratory measures, and baseline features for robust patient stratification and outcome prediction [2506.20065].

## 2. Mathematical Architecture: Supervised Coupled Matrix-Tensor Factorization

The SCMTF model assumes availability of a third-order tensor $\mathcal{X} \in \mathbb{R}^{I\times J\times K}$, where $I$ is the patient index, $J$ the set of time-varying variables (labs and PROs), and $K$ discrete time windows—here, seven bins of four months each, contextualized to key clinical events (e.g., medication initiation). Additionally, static feature matrices $M\in\mathbb{R}^{I\times D}$ (demographics, medication history, etc.) and binary outcome labels $y\in\{0,1\}^I$ (e.g., medication persistence at a specific time horizon) are provided.

The factorization posits a rank-$R$ coupled CANDECOMP/PARAFAC (CP) decomposition:

\[
\mathcal{X}\;\approx\;[\![\,\mathbf{A},\mathbf{B},\mathbf{C}\,]\!]  +  \mathbf{B}_{\text{feat}} + \mathbf{B}_{\text{pat}},
\]

where:

- $\mathbf{A} \in \mathbb{R}^{I\times R}$: patient–phenotype membership matrix
- $\mathbf{B} \in \mathbb{R}^{J\times R}$: variable–phenotype matrix (temporal features)
- $\mathbf{C} \in \mathbb{R}^{K\times R}$: time–pattern matrix
- $\mathbf{B}_{\text{feat}}\in \mathbb{R}^{J\times K}$: feature bias (offsets per feature)
- $\mathbf{B}_{\text{pat}}\in \mathbb{R}^{I\times K}$: patient bias (offsets per patient)

The static matrix $M$ is coupled via the patient mode:

\[
M \approx \mathbf{A} \mathbf{D}^\top, \quad \mathbf{D} \in \mathbb{R}^{D\times R}.
\]

A neural classifier $f: \mathbb{R}^R \to [0,1]$ with parameters $\Theta$ links $\mathbf{A}$ to clinical outcome via cross-entropy loss:

\[
L_{\text{sup}}(y, \hat{y}) = -\frac{1}{I}\sum_{i=1}^{I} [y_i\log \hat{y}_i + (1 - y_i)\log(1 - \hat{y}_i)],
\]

where $\hat{y}_i = f(\mathbf{A}_{i,:}; \Theta)$.

The total loss incorporates tensor and matrix reconstruction, $\ell_1$ sparsity, bias regularization, and the supervised loss, subject to nonnegativity constraints on all factor matrices.

## 3. Missing Data: Masking and Imputation

EHR and PRO data are typically characterized by severe missingness (up to 90%), particularly in longitudinal symptom reporting. SCMTF introduces binary masks $\Omega \in \{0,1\}^{I\times J\times K}$ and $\Psi \in \{0,1\}^{I\times D}$ to indicate observed entries in $\mathcal{X}$ and $M$ respectively. Reconstruction losses are masked via Hadamard product, ensuring that only observed entries contribute to the objective:

\[
L_{\text{tensor}} = \|\Omega \ast (\mathcal{X} - [\![\mathbf{A},\mathbf{B},\mathbf{C}]\!] - \mathbf{B}_{\text{feat}} - \mathbf{B}_{\text{pat}})\|_F^2.
\]

After optimization, missing entries in both $\mathcal{X}$ and $M$ are naturally imputed using the learned low-rank and bias structure.

## 4. Optimization Strategies and Hyperparameters

Training proceeds as joint all-at-once gradient-based optimization implemented in PyTorch, leveraging TensorLy-Torch for tensor operations. All factors $\{\mathbf{A},\mathbf{B},\mathbf{C},\mathbf{D}\}$, biases $\{\mathbf{B}_{\text{feat}}, \mathbf{B}_{\text{pat}}\}$, and classifier parameters $\Theta$ are updated simultaneously.

Key characteristics:

- Nonnegativity enforced by clamping factors after each step.
- Factor variables updated via Adam ($\text{lr} \approx 1\text{e-2}$); classifier via SGD ($\text{lr} \approx 1\text{e-2}$, momentum = 0.9)
- Learning rates decayed by $0.8$ every $1\,000$ steps
- $\ell_1$ sparsity handled by proximal-gradient/soft-thresholding
- Hyperparameters ($R$, $\lambda_1$, $\lambda_2$, $\lambda_{\text{sup}}$) selected through grid search on a held-out validation set, targeting AUC and imputation error

In the referenced work, the optimal configuration was $R=28$, $\lambda_{\text{sup}}=0.7$, and $\lambda_1=10^{-3}$ [2506.20065].

## 5. Application: Ulcerative Colitis Computational Phenotyping

For UC, the SCMTF workflow was instantiated as follows:

- $\mathcal{X}\in\mathbb{R}^{2303\times 58\times 7}$ comprising 24 laboratory variables and 34 PRO items, binned into seven 4-month intervals centered on medication start.
- $M \in \mathbb{R}^{2303\times 21}$ reflecting static demographics (age, sex, BMI), disease/therapy history, and baseline endoscopic scores.
- Labels $y$ marking medication persistence at 8 and 20 months.

Post-training, each rank component $r$ defines a distinct phenotype with interpretation derived from:

- $\mathbf{A}_{:,r}$: per-patient phenotype strengths
- $\mathbf{B}_{:,r}$: variable/PRO contributions
- $\mathbf{C}_{:,r}$: temporal evolution
- $\mathbf{D}_{:,r}$: static feature influences

Features with maximal loadings (e.g., arthritis pain, CRP, prior biologic use) and their corresponding time profiles informed clinical interpretations such as “chronic inflammation” or “episodic systemic symptoms.”

## 6. Predictive and Clinical Significance

The learned patient phenotypes, summarized by $\mathbf{A}$, served as covariates for medication persistence prediction with high accuracy:

- Random Forest on $\mathbf{A}$ yielded test AUC = 0.853 (8-month) and AUC = 0.803 (20-month)
- A subset of three dominant phenotypes preserved AUC > 0.80
- Imputation accuracy for missing tensor values was MAE $\approx$ 0.145, RMSE $\approx$ 0.197

Approximately 76% of tensor entries were missing (88% in PROs). The discovery of phenotypes featuring PROs indicates these data types, typically discarded for sparsity and subjectivity, contain clinically actionable information for outcome modeling in UC [2506.20065].

## 7. Context and Implications

SCMTF represents the first tensor-based, supervised, and coupled factorization applied to the UC domain and to highly missing PRO data. It offers a unified, interpretable modeling framework capable of:

- Jointly factorizing static and temporal, multi-modal clinical data
- Absorbing patient and feature bias
- Integrating clinical supervision directly in the factorization
- Handling massive missingness via masked loss
- Yielding interpretable latent phenotypes with demonstrable predictive utility

A plausible implication is the extension of similar SCMTF-based factorizations to broader EHR phenotyping tasks and other highly missing clinical data domains, where integration of multiple data types and interpretability are crucial for precision medicine [2506.20065].

Source: https://www.emergentmind.com/topics/roamm-ehr