| get_crossvalidated_model_fit | R Documentation |
Performs k-fold cross-validation on a model using the available datasets:
the datasets are split into n_folds groups, and for each fold the model
is fit (via xsl_fit()) to the other folds and evaluated (via
xsl_run()) on the held-out fold.
get_crossvalidated_model_fit(
model_name,
n_folds = 5,
datasets = NULL,
control = xslControl(),
deoptim_control = DEoptim::DEoptim.control(reltol = 0.001, NP = 100, itermax = 100)
)
model_name |
Name of the model to cross-validate (see |
n_folds |
Number of folds for cross-validation (default: 5) |
datasets |
Optional list of datasets to use (defaults to all available) |
control |
Control arguments passed to |
deoptim_control |
Control parameters passed to |
A list containing cross-validation results (see
cross_validated_group_fits())
# Get cross-validated fit for the decay model. A reduced DEoptim search
# keeps this example fast; drop deoptim_control for a real, thorough fit.
cv_fit <- get_crossvalidated_model_fit(
"decay", n_folds = 2, datasets = xsl_datasets[1:6],
deoptim_control = DEoptim::DEoptim.control(NP = 10, itermax = 5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.