LogoLogo
GitHubSlackDataCebo
  • RDT: Reversible Data Transforms
  • Getting Started
    • Installation
    • Quickstart
  • Usage
    • Basic Concepts
    • HyperTransformer
      • Preparation
      • Configuration
      • Transformation
  • Transformers Glossary
    • Numerical
      • ClusterBasedNormalizer
      • FloatFormatter
      • GaussianNormalizer
      • LogScaler
      • LogitScaler
      • * OutlierEncoder
      • ❖ DPECDFNormalizer
      • ❖ DPLaplaceNoiser
      • ❖ ECDFNormalizer
      • ❖ XGaussianNormalizer
    • Categorical
      • LabelEncoder
      • OrderedLabelEncoder
      • FrequencyEncoder
      • OneHotEncoder
      • OrderedUniformEncoder
      • UniformEncoder
      • BinaryEncoder
      • ❖ DPDiscreteECDFNormalizer
      • ❖ DPResponseRandomizer
      • ❖ DPWeightedResponseRandomizer
    • Datetime
      • OptimizedTimestampEncoder
      • UnixTimestampEncoder
      • ❖ DPTimestampLaplaceNoiser
    • ID
      • AnonymizedFaker
      • IndexGenerator
      • RegexGenerator
      • Treat IDs as categorical labels
    • Generic PII Anonymization
      • AnonymizedFaker
      • PseudoAnonymizedFaker
    • * Deep Data Understanding
      • * Address
        • * RandomLocationGenerator
        • * RegionalAnonymizer
      • * Email
        • * DomainBasedAnonymizer
        • * DomainBasedMapper
        • * DomainExtractor
      • * GPS Coordinates
        • * RandomLocationGenerator
        • * GPSNoiser
        • * MetroAreaAnonymizer
      • * Phone Number
        • * AnonymizedGeoExtractor
        • * NewNumberMapper
        • * GeoExtractor
  • Resources
    • Use Cases
      • Contextual Anonymization
      • Differential Privacy
      • Statistical Preprocessing
    • For Businesses
    • For Developers
Powered by GitBook
On this page
  • Parameters
  • Examples
  • FAQs
  1. Transformers Glossary
  2. * Deep Data Understanding
  3. * GPS Coordinates

* GPSNoiser

Previous* RandomLocationGeneratorNext* MetroAreaAnonymizer

Last updated 2 months ago

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_km=25.0)

Parameters

noise_km: Add this argument to determine the overall magnitude of noise to add, in kilometers

(default) 10.0

Add roughly 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_km=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.

*SDV Enterprise Feature. This feature is available to our licensed users and is not currently in our public library. For more information, visit our page to .

Explore SDV