Skip to contents

declare what a modelled attacker knows

Usage

attacker_knowledge(
  level = c("W", "M", "S"),
  quasi_identifiers,
  behavior = NULL,
  identifiers = NULL,
  weak_subset = NULL
)

Arguments

level

one of "W" (weak), "M" (medium) or "S" (strong)

quasi_identifiers

named character vector mapping column name to the kind of score to use for it. Any of the types [reid_score_types()] lists – `"num"`, `"char"`, `"dist"`, `"rank"`, `"idf"`, `"count"`, `"profile"`, `"span"`, `"containment"` – e.g. `c(AGE = "num", ZIP = "char")`. Use `"containment"` for a column the release publishes as *regions* (`"[30,40)"`, `"135****"`, 東京都): every other type compares the raw value with the printed region and measures the region's shape rather than the risk, which is why they refuse such a column outright (Issue #100).

behavior

named character vector, same form, of coarse behavioural features (visit counts, spend summaries, ...). Visible from level M.

identifiers

named character vector, same form, of columns that effectively fingerprint the original record. Visible only at level S.

weak_subset

character vector naming the quasi-identifier columns a level-W attacker sees. Defaults to the first `floor(n / 2)` (at least one) of `quasi_identifiers`, in the order given – pass this explicitly whenever the split matters to the conclusion.

Value

an object of class "attacker_knowledge"; `$visible` is the named character vector of column-to-score-type entries the attacker may use.

Examples

attacker_knowledge(
  "M",
  quasi_identifiers = c(AGE = "num", ZIP = "char", SEX = "char"),
  behavior = c(VISIT_COUNT = "num"),
  identifiers = c(FINGERPRINT = "num")
)
#> attacker knowledge: level M (medium)
#>   visible columns (4): AGE[num], ZIP[char], SEX[char], VISIT_COUNT[num]
#>   withheld (1): FINGERPRINT