This function adds metadata to the feature matrix to be later used as predictors
add.meta.pred(siamcat, pred.names, std.meta = TRUE, feature.type='normalized', verbose = 1)
object of class siamcat-class
vector of names of the variables within the metadata to be added to the feature matrix as predictors
boolean, should added metadata features be standardized?,
string, on which type of features should the function
work? Can be either
integer, control output:
an object of class siamcat-class with metadata added to the features
This functions adds one or several metadata variables to the set of features, so that they can be included for model training.
Usually, this function should be called before train.model.
Numerical meta-variables are added as z-scores to the feature matrix unless specified otherwise.
Please be aware, that non-numerical metadata variables will be converted to
numerical values by using
as.numeric() and could therefore lead to
errors. Thus, it makes sense to encode non-numerical metadata variables to
numerically before you start the SIAMCAT workflow.
data(siamcat_example) # Add the Age of the patients as potential predictor siamcat_age_added <- add.meta.pred(siamcat_example, pred.names=c('Age'))#># Add Age and BMI as potential predictors # Additionally, prevent standardization of the added features siamcat_meta_added <- add.meta.pred(siamcat_example, pred.names=c('Age', 'BMI'), std.meta=FALSE)#>