| cross_validate_tna | R Documentation |
Each iteration splits the sequences once into a training and a testing set,
fits every estimator to both halves, and compares the two networks with
compare_networks().
cross_validate_tna(
data,
models = c("tna", "ftna", "ctna", "atna"),
iterations = 20L,
training_fraction = 0.7,
format = c("auto", "long", "wide"),
id = "id",
period = "period",
state = "state",
seed = NULL,
...
)
data |
Sequence data in long or wide form. |
models |
Character vector of TNA estimators to compare, any of |
iterations |
Number of train/test splits, a whole number of at least 1,
default |
training_fraction |
Fraction of sequences assigned to the training
half, strictly between 0 and 1, default |
format, id, period, state |
Arguments describing the shape and column
names of |
seed |
Optional single seed, restored on exit. |
... |
Further arguments passed to |
A plain base data.frame with one row per iteration and estimator
and the columns iteration, model, and the compare_networks()
agreement metrics pearson, cosine, mae, rmse, jaccard, edges_x
and edges_y. This is not a simulab_sim.
data <- simulate_sequences(n = 60, n_states = 3, chain_length = 12, seed = 1)
if (requireNamespace("tna", quietly = TRUE)) {
cross_validate_tna(data, models = c("tna", "ftna"), iterations = 2, seed = 1)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.