How much of the combinations to cover a sample covers.
Arguments
- model
A model, from
vp_generate()orvp_read(), in its complete or its minimal form.- sample
One row per configuration, one 0/1 or logical column per variable feature.
Value
One row per t (1 and 2): t, covered, to_cover and coverage
(the share). Combinations that the sample has but that are impossible are
not counted (see vp_sample_violations()).
Examples
band <- vp_generate(vp_example("miband3.uvl"), or_graph = TRUE)
nodes <- with(vp_features(band), feature[status == "variable"])
sample <- as.data.frame(matrix(
c(1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1),
nrow = 2,
dimnames = list(NULL, nodes)
))
vp_coverage(band, sample)
#> # A tibble: 2 × 4
#> t covered to_cover coverage
#> <int> <int> <dbl> <dbl>
#> 1 1 21 22 0.955
#> 2 2 84 163 0.515