View source: R/quantile_normalize_bart.R
preprocess_df | R Documentation |
Preprocesses a data frame for use with softbart
; not needed with other
model fitting functions, but may also be useful when designing custom methods
with MakeForest
. Returns a data matrix X that will work with
categorical predictors, and a vector of group indicators; this is required to
get sensible variable selection for categorical variables, and should be
passed in as the group argument to Hypers
.
preprocess_df(X)
X |
A data frame, possibly containing categorical variables stored as factors. |
A list containing two elements.
X
: a matrix consisting of the columns of the input data frame,
with separate columns for the different levels of categorical variables.
group
: a vector of group memberships of the predictors in
X
, to be passed as an argument to Hypers
.
data(iris)
preprocess_df(iris)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.