Description Usage Arguments Details Value Note Author(s) References Examples
This function trains a dose-response model \insertCitebusso2003variablesysmod with or without validation procedure.
1 2 3 4 5 6 7 8 9 |
data |
A data frame object that contains at least training loads, performances and time between two consecutive sessions. |
vars |
A list that contains input (i.e. session training loads, numeric) and time (i.e. the time between two consecutive inputs) vectors. |
target |
A character that indicates the performances column name. |
date_ID |
A character that indicates the date time object name. |
specify |
Default is |
validation.method |
Default is |
specs |
Default is |
validation.method can be used to train and evaluate model within a cross-validation procedure. Methods available are "none"
, "simple"
and "TS-CV"
for no validation, a simple data split into training / testing sets and time-series cross-validation respectively.
specs lets define data splitting specifications. For the "simple"
method, specify decimals as the proportion of the data to be used for model training in "initialWindow"
, the proportion of data used for model evaluation in
"horizon"
and logical term for the "fixedWindow"
within a list.
For the "TS-CV"
method, specify numeric values for "initialWindow"
, "horizon"
and logical term for the "fixedWindow"
within a list.
Each of the optimization algorithm with constraints and used by optimx can be used in "optim.method"
.
A list describing the model output and its performances.
Model performances (RMSE, MAE and R squared) are calculated on data used for validation = c("simple", "TS-CV").
Frank Imbach frankimbach@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ## Not run: No validation, default optimization specs.
model_results <- sysmod(data = example_data,
vars = list("input" = example_data$training_load, "time" = example_data$rest),
target = "perf", date_ID = "datetime",
validation.method = "none")
P0_init = init_perf(data = example_data, target = "perf")
theta_init <- c(P0_init = P0_init, k1_init = 0.5, k3_init = 0.1, tau1_init = 40, tau2_init = 20, tau3_init = 5)
lower <- c(P0_init - 0.10 * P0_init, 0, 0, 10, 1, 1)
upper <- c(P0_init, 1, 1, 80, 40, 10)
## Not run: No validation, custom optimization.
model_results <- sysmod(data = example_data,
vars = list("input" = example_data$training_load, "time" = example_data$rest),
target = "perf", date_ID = "datetime",
specify = list("theta_init" = theta_init, "lower" = lower, "upper" = upper, "optim.method" = "nlm"),
validation.method = "none")
## Not run: Simple split example, custom optimization.
model_results <- sysmod(data = example_data,
vars = list("input" = example_data$training_load, "time" = example_data$rest),
target = "perf", date_ID = "datetime",
specify = list("theta_init" = theta_init, "lower" = lower, "upper" = upper, "optim.method" = "nlm"),
validation.method = "simple",
specs = list("initialWindow" = 0.8, "horizon" = 0.2, "fixedWindow" = FALSE))
## Not run: TS-CV example, custom optimization.
model_results <- sysmod(data = example_data,
vars = list("input" = example_data$training_load, "time" = example_data$rest),
target = "perf", date_ID = "datetime",
specify = list("theta_init" = theta_init, "lower" = lower, "upper" = upper, "optim.method" = "nlm"),
validation.method = "TS-CV",
specs = list("initialWindow" = 50, "horizon" = 15, "fixedWindow" = FALSE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.