View source: R/summary_2rm_helpers.R
DualCP_LOSO | R Documentation |
Perform leave-one-participant-out-cross-validation on a two-regression algorithm
DualCP_LOSO( subject_var = "id", data, model, MET_var = "MET_RMR", activity_var = "Behavior", verbose = FALSE, trace = FALSE ) fold(x, subject_var, data, model, MET_var, activity_var, trace) get_cv_predictions(model, fold_data, cv_data) get_fold_model(formula_string, fold_data, level = c("walkrun", "intermittent")) get_classifications( data, model, numeric = TRUE, labels = c("SB", "walkrun", "intermittent") )
subject_var |
character. Variable name that distinguishes between participants |
data |
the full data set to cross-validate |
model |
a |
MET_var |
character. The outcome variable name (in metabolic equivalents) |
activity_var |
character. The variable name for the activity being performed |
verbose |
logical. Print updates? |
trace |
logical. Print information about each iteration? |
x |
character. The id to hold out |
fold_data |
the validation data set |
cv_data |
the holdout (i.e., cross-validation) data set |
formula_string |
character. Formula to apply in call to |
level |
character. Classification subset to include in call to |
A data frame with predictions obtained from leave-one-participant-out-cross-validation
This function will not work for TwoRegression
objects formed
from previously-published research. The TwoRegression
object needs
to have more information than is available in those cases in order to
perform cross-validation, and this is sensible, since there is no reason or
way to re-perform cross-validation on an already-finalized algorithm.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.