Use when a masked dataset must be proven to meet a k-anonymity, l-diversity or t-closeness threshold before it reaches a non-production environment. Computes equivalence classes over chosen quasi-identifiers with pycanon or ARX, reports re-identification risk and gates CI.
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Referenced from SKILL.md Step 7. Use ARX when the masking step itself must be performed, or when a GUI workflow is required (arx.deidentifier.org/development/api).
// Load data
Data data = Data.create("masked.csv", Charset.defaultCharset(), ';');
// Classify attributes
data.getDefinition().setAttributeType(
"diagnosis", AttributeType.SENSITIVE_ATTRIBUTE);
data.getDefinition().setAttributeType(
"age", AttributeType.QUASI_IDENTIFYING_ATTRIBUTE);
// Configure privacy models
ARXConfiguration config = ARXConfiguration.create();
config.addPrivacyModel(new KAnonymity(10));
config.addPrivacyModel(new EntropyLDiversity("diagnosis", 3));
config.addPrivacyModel(new EqualDistanceTCloseness("diagnosis", 0.2d));
config.setSuppressionLimit(0.02d); // suppress at most 2 % of rows
// Anonymize and read result
ARXAnonymizer anonymizer = new ARXAnonymizer();
ARXResult result = anonymizer.anonymize(data, config);
ARXNode optimal = result.getOptimalTransformation();Per arx.deidentifier.org/development/api,
KAnonymity(n), EntropyLDiversity(attr, n),
EqualDistanceTCloseness(attr, t), and
HierarchicalDistanceTCloseness(attr, t, hierarchy) are the key
privacy-model classes. setSuppressionLimit(0.02d) caps the fraction
of records ARX may suppress to achieve the target models.
Per arx.deidentifier.org/anonymization-tool: