Skip to content

riskutility

0.2.0Package record

Disclosure Risk and Data Utility Metrics for Synthetic and Anonymized Data

0packages depend
1.4Kdownloads / year
75.8%test coverage
13/13flavors OK

Overview

About

Provides comprehensive methods to measure disclosure risk and data utility for anonymized and synthetic data. Implements attribution-based risk metrics including Correct Attribution Probability (CAP), Targeted CAP (TCAP), Within Equivalence Class Attribution Probability (WEAP), and RAPID (Risk of Attribute Prediction-Induced Disclosure). Also provides distance-based privacy metrics such as Distance to Closest Record (DCR), Nearest Neighbor Distance Ratio (NNDR), and Identical Match Share (IMS). Utility assessment includes propensity score analysis, distribution comparisons, and various statistical tests. Methods are based on Taub et al. (2018) doi:10.1007/978-3-319-99771-1_9 and related literature. Designed for integration with 'simPop' S4 classes.

Changes in 0.2.0

Bug fixes and one API addition, all surfaced while preparing the JSS software

paper. Three of these change reported values, so results produced with 0.1.0

are not directly comparable.

New

  • tcap() gains cont_bins (default 10), matching dcap(). A continuous target is now discretised into quantile bins before matching. Previously an exact match on a continuous value essentially never occurred and every TCAP score collapsed to zero.
  • tcap() now reports all three TCAP variants in use in the literature and gains a kind argument ("certain", the default; "matched"; "conditional") that selects which one print()/summary() highlight -- reported values are unchanged. tcap_certain keeps riskutility's strict definition (the key uniquely determines the target in both the original and the synthetic data). The new tcap_matched reproduces synthpop's TCAP as defined up to synthpop 1.9-2; the new tcap_conditional implements the definition of Little, Allmendinger & Elliot (2025, Journal of Official Statistics 41(1), 255-308), which synthpop adopts from version 1.9-3. The previous documentation claim that tcap_certain equals synthpop's TCAP held only on data where every disclosive synthetic key class is also unambiguous in the original data; the documentation now states the exact mapping.
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0

Bug fixes (change reported values)

  • propscore(): the synthetic-side kernel density was indexed with length(ps) -- a scalar -- rather than nrow(p), so the index ran backwards and every density diagnostic reported by summary() (kl, density_ratio, mean_ratio, sd_ratio and their Bayes-space counterparts) was computed on the wrong records.
  • tstr(): R-squared is now clamped at 0, and the TSTR/TRTR ratio is returned as NA with a warning when the train-on-real model has no predictive power. Previously two negative R-squared values could divide to a large positive ratio and be reported as excellent utility.
  • tail_fidelity(): the Jensen-Shannon divergence is now computed in density space. It previously used Bayes-space (clr) ordinates, which are sign-indefinite, and could return values far outside [0, log 2].

Other

  • dcr() now warns when the training and holdout sets differ in size. The dcr_share reference value of 0.5 and the 0.55 rule used by privacy_pass assume equal sizes; with an unequal split the expected share under no memorisation is n_train / (n_train + n_holdout).
  • Tests that compare riskutility against synthpop output are now version-aware (synthpop 1.9-3 redefines its TCAP measure) and are skipped on CRAN, as requested by the synthpop maintainers and the CRAN team. They continue to run in local devtools::test() runs.
  • print.tcap() no longer errors on a result with zero matched records.
  • compare_feature_importance(importance_type = "permutation") no longer requires the vip package (archived from CRAN on 2026-07-08 and therefore flagged by the CRAN incoming checks): permutation importance is computed internally, and the documented caret-style metric names ("Accuracy", "Kappa", "ROC AUC", "RMSE", "MAE", "MAPE", "R-squared") as well as custom metric functions are handled directly, with error metrics sign-flipped so that larger importance always means a more influential feature. vip was removed from Suggests.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 10.6 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK6 OK2026-06-23
Advisories

none known

Documentation

In release 0.2.0
READMEYes · 1,197 wordsVignettesYes · 1 · evaluation depends on the environmentNEWSYes · 100% structured · mentions 0.2.0Citation fileYes · cites a publicationWebsitenot declared in DESCRIPTION
Help pages
328 (43 internal)includes a package overview page
Examples that run
89%75 run in a plain check · 9 only when donttest examples are enabled (R CMD check --as-cran)
Exported functions with examples
93%
Documented parameters
97%
Return-value docs
100%
Help pages citing references
16%

Downloads

1.4K
CRAN downloads in the past year
Rank #9,555 · ~4/day · ~117/mo
Daily download trend is not available in this view yet.
37330 days
1K90 days
1.4K1 year
Compare downloads with other packages →
Also on37 r2u6 autocran

Repository

2Stars
0Forks
3Open issues
0Open PRs
0Releases
125Commits
3Commit identities
License file reads as GPL-3.0 · 125 commits · Last activity 2026-09-01 · 0% stars, 30d
Responsiveness
not measured

Stars over time

2026-07-14 · 12026-08-05 · 2
PracticesBeta

2 development-tooling and community-health practices detected across 2 families in the upstream repository

Checks run against github.com/matthias-da/riskutility on 2026-10-18.

CRAN release process (1)
cran-comments.md
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-01-28
    Seen in the repository: CLAUDE.md
    Named in .Rbuildignore: .claude, CLAUDE.md
    Named in .gitignore: .claude, CLAUDE.md
    Commits: at least 65 crediting it in the message
  • Gemini CLIfirst seen on or before 2026-07-18
    Config: a file or ignore line, not recorded which
Models named in its commits
  • Claude Opus 4.650 commits · Mar 2026
  • Claude Sonnet 4.69 commits · Mar 2026
  • Claude Opus 54 commits · Aug 2026
  • Claude Fable 52 commits · Sep 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
28 external dependencies (excludes base and recommended)

Installing riskutility adds 40 packages (26 with compiled code, 55 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, data.table 5.7 MB.

Depends (1)
R >= 4.1.0
Imports (10)
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (2)
Author, Maintainer since 0.1.0 (2026)
Contributor
Releases (2)

Pick two releases to compare their code metrics.

  • 0.2.0Latest
    record
    2026-09-02 · current release · diff ↗
  • 0.1.0
    record
    first seen 2026-06-22
  • R
    R 4.6.0 released · 2026-04-24

Package metadata

First seen
2026-06-22
Total releases
2 / 1 yrs
License
GPL-3 OSI
Minimum R
≥ 4.1.0
Download size
1.2 MB

Cite

Cite this package

Run in R for the authors' entry:

citation("riskutility")

The package provides a citation file, so citation() returns the authors' own entry.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for riskutility version 0.2.0 [Data set]. HJJB, LLC. Data release v2026-10-21. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy