fn.fit_outcome_model: Fit random forest outcome model and generate predicted...

View source: R/stage-2-functions.R

fn.fit_outcome_modelR Documentation

Fit random forest outcome model and generate predicted outcomes

Description

Fits a random forest regressor for each outcome column using covariates X, study membership S, and group membership Z. Predicts each subject's outcome under their actual group. These predictions are used in fn.Stage2 when outcome_model = TRUE.

Usage

fn.fit_outcome_model(data, crossfit_folds = NULL)

Arguments

data

Structured data list containing X, S, Z, Y, N, J, K, p

crossfit_folds

Integer >= 2 for K-fold cross-fitting, or NULL (default) to fit on the full data.

Value

Matrix of dimension N \times L of predicted outcomes. Y_hat[i, l] is the predicted outcome for individual i under their actual group for outcome l.


WMAP documentation built on Oct. 6, 2026, 1:07 a.m.