* GPSNoiser

*SDV Enterprise Feature. This feature is available to our licensed users and is not currently in our public library. To learn more about the SDV Enterprise and its extra features, visit our website.

The GPSNoiser creates realistic GPS coordinates from roughly the same areas as the real data. When transforming your data, it adds noise using a pre-defined distance to preserve privacy. When reverse transforming, it chooses from the noised data points.

from rdt.transformers.gps import GPSNoiser

transformer = GPSNoiser(noise_radius=25.0)

Parameters

noise_radius: Add this argument to determine the overall magnitude of noise to generate, in kilometers

(default) 10.0

Add 10km noise to the real GPS coordinates, in any direction For reference, 10km is roughly the diameter of a city like Paris

<float>

A floating point value in the range (0.0, 1000.0) that describes the noise radius. For reference 1000km is roughly the length of California, or the distance between Paris and Barcelona.

Examples

This transformer takes exactly 2 columns as input. Make sure that you have 1 column with sdtype latitude and 1 column with sdtype longitude.

from rdt.transformers.gps import GPSNoiser

transformer = GPSNoiser(noise_radius=25.0)

# in the hypertransformer, ensure that each column has a supported sdtype
ht.update_sdtypes(column_name_to_sdtype={
    'user_lat': 'latitude',
    'user_lon': 'longitude',
})

# in the hypertransformer, assign set of columns to your transformer
ht.update_transformers(column_name_to_transformer={
    ('user_lat', 'user_lon'): transformer
})

FAQs

What happens to missing values?

This transformer recreates missing GPS coordinates during the reverse transform phase in the same proportion as the original data.

Note that a GPS coordinate is considered missing if either the latitude or longitude are null.

Last updated