| cross_validated_group_fits | R Documentation |
This function runs k-fold cross-validation for group fits of a specified
model using a set of conditions. On each fold, the model is fit (via
xsl_fit()) to the training conditions, and the fitted model is then
evaluated (via xsl_run()) on the held-out test conditions to obtain an
out-of-sample SSE.
cross_validated_group_fits(
model,
combined_data,
lower,
upper,
n_folds = 5,
control = xslControl(),
deoptim_control = DEoptim::DEoptim.control(reltol = 0.001, NP = 100, itermax = 100),
seed = NULL
)
model |
An object of class |
combined_data |
A list of |
lower |
Numeric vector of lower bounds for the model's parameters. |
upper |
Numeric vector of upper bounds for the model's parameters. |
n_folds |
Number of folds (default: 5). |
control |
Control arguments passed to |
deoptim_control |
Control parameters passed to |
seed |
Optional random seed, for reproducible fold assignment. |
A list containing cross-validation results:
folds: a list (one per fold) with the fitted params, train_sse
(in-sample), and test_sse (out-of-sample).
params: a matrix of fitted parameters, one row per fold.
train_sse / test_sse: numeric vectors of per-fold SSE.
# A reduced DEoptim search keeps this example fast; drop
# deoptim_control for a real, thorough fit.
cross_validated_group_fits(decay(C = 0.98), xsl_datasets[1:6],
lower = 0.8, upper = 1.0, n_folds = 2,
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.