Skip to contents

How far apart every two versions are: the Jaccard similarity of one graph among the features that can vary in both (the measure of vp_compare()), for every pair of versions, not only consecutive ones. A version much closer to an older one than to the one just before it reverted a change.

Usage

vp_version_distance(history, graph = c("requires", "excludes", "atleastone"))

Arguments

history

A history: the versions of a model, from vp_read_history() or vp_history(), oldest first.

graph

Which graph: "requires", "excludes" or "atleastone" (the last one needs or_graph = TRUE in vp_generate()).

Value

A tibble with from, to (every pair, the older first), kept, jaccard and distance (1 - jaccard).

Examples

gens <- c("miband1", "miband2", "miband3", "miband4", "miband6")
history <- vp_history(
  vp_example(paste0(gens, "_realized.uvl")),
  versions = gens,
  or_graph = TRUE
)
vp_version_distance(history)
#> # A tibble: 10 × 5
#>    from    to       kept jaccard distance
#>    <fct>   <fct>   <int>   <dbl>    <dbl>
#>  1 miband1 miband2     0   1        0    
#>  2 miband1 miband3     0   1        0    
#>  3 miband1 miband4     0   1        0    
#>  4 miband1 miband6     0   1        0    
#>  5 miband2 miband3     8   0.353    0.647
#>  6 miband2 miband4     8   0.364    0.636
#>  7 miband2 miband6     8   0.235    0.765
#>  8 miband3 miband4    11   0.344    0.656
#>  9 miband3 miband6    11   0.586    0.414
#> 10 miband4 miband6    17   0.364    0.636