Last updated: Feb 11, 2025
The Anonymize node transforms the way field names and values
are represented downstream, thus disguising the original data. This can be useful if you want to
allow other users to build models using sensitive data, such as customer names or other details.
Example
stream = modeler.script.stream()
typenode = stream.findByID("id42KW3MSA94B")
node = stream.createAt("anonymize", "My node", 192, 96)
stream.link(typenode, node)
# Anonymize node requires the input fields while setting the values
node.setKeyedPropertyValue("enable_anonymize", "Age", True)
node.setKeyedPropertyValue("transformation", "Age", "Random")
node.setKeyedPropertyValue("set_random_seed", "Age", True)
node.setKeyedPropertyValue("random_seed", "Age", 123)
node.setKeyedPropertyValue("enable_anonymize", "Drug", True)
node.setKeyedPropertyValue("use_prefix", "Drug", True)
node.setKeyedPropertyValue("prefix", "Drug", "myprefix")
properties |
Data type | Property description |
---|---|---|
|
flag | When set to , activates anonymization of field values (equivalent to
selecting Yes for that field in the Anonymize Values column). |
|
flag | When set to , a custom prefix will be used if one has been specified.
Applies to fields that will be anonymized by the Hash method and is equivalent to choosing the
Custom option in the Replace Values settings for that field. |
|
string | Equivalent to typing a prefix into the text box in the Replace Values settings. The default prefix is the default value if nothing else has been specified. |
|
|
Determines whether the transformation parameters for a field anonymized by the Transform method will be random or fixed. |
|
flag | When set to , the specified seed value will be used (if
is also set to ). |
|
integer | When is set to , this is the seed for
the random number. |
|
number | When is set to , this value is used for
"scale by." The maximum scale value is normally 10 but may be reduced to avoid overflow. |
|
number | When is set to , this value is used for
"translate." The maximum translate value is normally 1000 but may be reduced to avoid
overflow. |
Was the topic helpful?
0/1000