Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for latitude/longitude pairs (GPS) #1617

Closed
npatki opened this issue Oct 3, 2023 · 1 comment
Closed

Support for latitude/longitude pairs (GPS) #1617

npatki opened this issue Oct 3, 2023 · 1 comment
Labels
feature request Request for a new feature resolution:resolved The issue was fixed, the question was answered, etc.

Comments

@npatki
Copy link
Contributor

npatki commented Oct 3, 2023

Problem Description

I'm filing this feature request on behalf of other users who want to model latitude/longitude pairs in their data. The latitude and longitude are present as two separate columns. Together, the pair determines a GPS location.

Expected behavior

The SDV synthesizers should be able to understand the latitude and longitude as a location pair. They should create synthetic data that are generally in the same locations as the original data.

Additional context

Some users have tried adding constraints for this, but as evidenced by #1591, custom constraints won't exactly work.

The overall feature can behave similarly to addresses, as seen in #1593.

@npatki npatki added the feature request Request for a new feature label Oct 3, 2023
@npatki
Copy link
Contributor Author

npatki commented Feb 20, 2024

This feature has now been added, available in Beta for SDV users on our paid plans.

Usage

  1. In the metadata, annotate which pairs of latitude/longitude columns belong together. Use the add_column_relationship API method to do this. One of the columns must be sdtype latitude while the other must be sdtype longitude. You can add multiple pairs.
metadata.add_column_relationship(
  table_name='rides',
  type='gps',
  column_names=['start_lat', 'start_lon'])

metadata.add_column_relationship(
  table_name='rides',
  type='gps',
  column_names=['end_lat', 'end_lon'])
  1. That's it! SDV synthesizers will now accommodate these lat/lon pairs when modeling and creating synthetic data.
synthesizer = HSASynthesizer(metadata)
synthesizer.fit()
synthetic_data = synthesizer.sample()

Note that this feature is only available for SDV users on our paid plans.

@npatki npatki closed this as completed Feb 20, 2024
@npatki npatki added the resolution:resolved The issue was fixed, the question was answered, etc. label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature resolution:resolved The issue was fixed, the question was answered, etc.
Projects
None yet
Development

No branches or pull requests

1 participant