adjust_frm {FastRet} | R Documentation |
Adjust an existing FastRet model for use with a new column
Description
The goal of this function is to train a model that predicts RT_ADJ (retention time measured on a new, adjusted column) from RT (retention time measured on the original column) and to attach this "adjustmodel" to an existing FastRet model.
Usage
adjust_frm(
frm = train_frm(),
new_data = read_rpadj_xlsx(),
predictors = 1:6,
nfolds = 5,
verbose = 1
)
Arguments
frm |
An object of class |
new_data |
Dataframe with columns "RT", "NAME", "SMILES" and optionally a set of chemical descriptors. |
predictors |
Numeric vector specifying which predictors to include in the model in addition to RT. Available options are: 1=RT, 2=RT^2, 3=RT^3, 4=log(RT), 5=exp(RT), 6=sqrt(RT). |
nfolds |
An integer representing the number of folds for cross validation. |
verbose |
A logical value indicating whether to print progress messages. |
Value
An object of class frm
, which is a list with the following elements:
-
model
: A list containing details about the original model. -
df
: The data frame used for training the model. -
cv
: A list containing the cross validation results. -
seed
: The seed used for random number generation. -
version
: The version of the FastRet package used to train the model. -
adj
: A list containing details about the adjusted model.
Examples
frm <- read_rp_lasso_model_rds()
new_data <- read_rpadj_xlsx()
frmAdjusted <- adjust_frm(frm, new_data, verbose = 0)