preprocessTrainData: Preprocess covariates for use in a 'ForestDataset' at train...

View source: R/utils.R

preprocessTrainDataR Documentation

Preprocess covariates for use in a ForestDataset at train time.

Description

Preprocess covariates for use in a ForestDataset at train time. DataFrames will be preprocessed based on their column types. Matrices will be passed through assuming all columns are numeric.

Usage

preprocessTrainData(input_data)

Arguments

input_data

Covariates, provided as either a dataframe or a matrix

Value

List with preprocessed (unmodified) data and details on the number of each type of variable, unique categories associated with categorical variables, and the vector of feature types needed for calls to BART and BCF.

Examples

cov_mat <- matrix(1:12, ncol = 3)
preprocess_list <- preprocessTrainData(cov_mat)
X <- preprocess_list$X

stochtree documentation built on Nov. 22, 2025, 9:06 a.m.