Skip to contents

Groups records into equivalence blocks by their quasi-identifiers and evaluates the three diversity criteria of Machanavajjhala et al. (2007) on the sensitive attribute within each block:

Usage

morie_ldiff(X, quasi_ids, sensitive, l, c = 1)

Arguments

X

Records; only the length is used, to check the blocks.

quasi_ids

Quasi-identifier matrix, one row per record.

sensitive

Sensitive attribute per record (compared as labels, so numbers and strings both work).

l

Required diversity level (at least 1).

c

Constant of recursive (c, l)-diversity (positive).

Value

A list with elements estimate, distinct_l, entropy_l, min_entropy, c_min, satisfies_distinct, satisfies_entropy, satisfies_recursive, n_blocks, min_block_size, l, c, n, method.

Details

  • distinct l-diversity: every block holds at least l distinct sensitive values (their Definition 4.1 discussion);

  • entropy l-diversity: every block has Shannon entropy of the sensitive distribution at least log(l) (Definition 4.1);

  • recursive (c, l)-diversity: in every block, with counts r_1 >= r_2 >= ... >= r_m, r_1 < c (r_l + ... + r_m) (Definition 4.2).

The reported c_min is the largest r_1 / (r_l + ... + r_m) over blocks, so the release is recursive (c, l)-diverse exactly when c_min < c.

References

Machanavajjhala, A., Kifer, D., Gehrke, J. and Venkitasubramaniam, M. (2007). l-diversity: privacy beyond k-anonymity. ACM Transactions on Knowledge Discovery from Data, 1(1), article 3.

Examples

qi <- cbind(age = c(30, 30, 30, 40, 40, 40), zip = c(1, 1, 1, 2, 2, 2))
s <- c("flu", "cold", "flu", "cancer", "flu", "cold")
morie_ldiff(X = seq_len(6), quasi_ids = qi, sensitive = s, l = 2)[c("distinct_l", "satisfies_distinct")]
#> $distinct_l
#> [1] 2
#> 
#> $satisfies_distinct
#> [1] 1
#>