Benchmark time and memory performance of various calculations of Rand index

rand_index_benchmark(
  return_plot = c("combined", "memory", "time")[1],
  calls = c("randex::rand_index(a, b)", "clusteval::rand(a, b)",
    "matchFeat::Rand.index(a, b)", "fossil::rand.index(a, b)",
    "ClustOfVar::rand(a, b, adj =  FALSE)", "hecmulti::rand(a, b)"),
  N = 2^(10:25),
  string_space = letters,
  string_length = 4,
  mem_max = 30 * (2^10)^3,
  time_max = 5 * 60,
  return_data = FALSE,
  rds_file = NULL,
  profmem_type = c("allocation", "snapshot")[1],
  highlight_call = "randex::rand_index(a, b)"
)

Arguments

return_plot

Type of plot to return

calls

Benchmark calls that calculate Rand index for set 'a' and 'b', e.g., 'randex::rand_index(a, b)'

N

Integer vector of sizes for clustered sets. Sizes should be in increasing order.

string_space

Character space for cluster names (all ascii letters by default)

string_length

Length of clusted names. Kind of a proxy for number of possible clusters.

mem_max

Stop benchmarking if last result took more than specified number of bites of RAM (30Gb default)

time_max

Stop benchmarking if last result took longer than specified number of seconds (5 minutes default)

return_data

Do not visualize results. Just return benchmarks data for saving.

rds_file

Use this as data for visualizing previously calculated benchmarks obtained from randex_benchmark(..., return_data = TRUE)

profmem_type

Type of memory profiling. "allocation" type uses utils::Rprofmem() (for which R should be compiled with '--enable-memory-profiling' option). "snapshot" memory profiling type uses utils::Rprof(prof, memory.profiling = TRUE). See more details here - https://cran.r-project.org/web/packages/profmem/vignettes/profmem.html

highlight_call

Call from call to be highlighted

Value

Plot or data