Description Usage Arguments Value
View source: R/modelingSL_main.R
Define and fit discrete SuperLearner for growth curve modeling. Model selection (scoring) can be based on either MSE for a single random (or last) holdout data-point for each subject (method = "holdout") or V-fold cross-validated MSE which uses entire subjects (entire growth curves) for model validation (method = "cv").
1 2 3 4 5 6 7 8 | fit_growth(...)
## S3 method for class 'ModelStack'
fit_growth(models, method = c("none", "cv", "holdout",
"holdout_cv", "SL"), data, ID, t_name, x, y, nfolds = NULL,
fold_column = NULL, hold_column = NULL, hold_random = FALSE,
seed = NULL, use_new_features = FALSE, refit = TRUE,
verbose = getOption("gridisl.verbose"), ...)
|
... |
Additional arguments that will be passed on to |
models |
Parameters specifying the model(s) to fit.
This must be a result of calling |
method |
The type of model selection procedure when fitting several models. Possible options are "none" (no model selection), "holdout" – model selection based on validation holdout sample; "holdout_cv" – ; "cv" – model selection using V-fold cross-validation; "SL" – perform model stacking (combine all models) with Super Learner using V-fold cross-validation predictions. |
data |
Input dataset, can be a |
ID |
A character string name of the column that contains the unique subject identifiers. |
t_name |
A character string name of the column with integer-valued measurement time-points (in days, weeks, months, etc). |
x |
A vector containing the names of predictor variables to use for modeling.
If x is missing, then all columns except |
y |
A character string name of the column that represent the response variable in the model. |
nfolds |
Number of folds to use in cross-validation. |
fold_column |
The name of the column in the input data that contains the cross-validation fold indicators (must be an ordered factor). |
hold_column |
The name of the column that contains the holdout observation indicators (TRUE/FALSE) in the input data. This holdout column must be defined and added to the input data prior to calling this function. |
hold_random |
Logical, specifying if the holdout observations should be selected at random. If FALSE then the last observation for each subject is selected as a holdout. |
seed |
Random number seed for selecting a random holdout. |
use_new_features |
Set to |
refit |
Set to |
verbose |
Set to |
An R6 object containing the model fit(s).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.