* RandomLocationGenerator
The RandomLocationGenerator
creates realistic, worldwide addresses. It transforms the real data by dropping all the address-related columns. Then when reverse transforming, it generates random, realistic locations from around the world. Use this transformer when you want to completely anonymize your address data.

from rdt.transformers.address import RandomLocationGenerator
transformer = RandomLocationGenerator(locales=['en_US'])
Parameters
locales
: An optional list of locales to use when generating addresses. All addresses will be chosen from the list of available countries with the provided languages.
missing_value_generation
: Add this argument to determine how to recreate missing values during the reverse transform phase
(default) 'random'
Randomly assign missing values in roughly the same proportion as the original data.
None
Do not recreate missing values.
Examples
from rdt.transformers.address import RandomLocationGenerator
transformer = RandomLocationGenerator(
locales=['en_US', 'fr_CA'],
missing_value_generation='random'
)
# in the hypertransformer, ensure that each column has a supported sdtype
ht.update_sdtypes(column_name_to_sdtype={
'addr_1': 'street_address',
'city_name': 'city',
'state': 'state_abbr',
})
# in the hypertransformer, assign set of columns to your transformer
ht.update_transformers(column_name_to_transformer={
('addr_1', 'city_name', 'state'): transformer
})
FAQs
Worldwide, regional data is provided by www.geonames.org.
Last updated