View source: R/boot_and_evaluate.R
| boot_and_evaluate | R Documentation |
Performs bootstrap evaluation of network analysis algorithms.
boot_and_evaluate(
data,
true_network,
algorithms,
correlation_methods,
sample_sizes = c(100, 250, 500, 1000),
n_simulations = 100,
seed = NULL,
n_cores = 2
)
data |
Data frame with the data. |
true_network |
Reference network used as the truth: an object returned
by |
algorithms |
Vector of algorithm names to evaluate. |
correlation_methods |
Vector of correlation methods. |
sample_sizes |
Vector of sample sizes to test (default c(100, 250, 500, 1000)). |
n_simulations |
Number of simulations (default 100). |
seed |
Optional random seed for reproducible results. |
n_cores |
Number of cores for parallel processing (default 2). With
|
Data frame with performance metrics.
set.seed(123)
n <- 300
f1 <- rnorm(n)
f2 <- 0.3 * f1 + rnorm(n)
items <- data.frame(
sapply(1:4, function(i) 0.7 * f1 + rnorm(n, 0, 0.7)),
sapply(1:4, function(i) 0.7 * f2 + rnorm(n, 0, 0.7))
)
names(items) <- c(paste0("A", 1:4), paste0("B", 1:4))
true_net <- EGAnet::EGA(items, plot.EGA = FALSE)
res <- boot_and_evaluate(items, true_network = true_net,
algorithms = "walktrap",
correlation_methods = "pearson",
sample_sizes = c(100, 200),
n_simulations = 2, seed = 1, n_cores = 1)
head(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.