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

Create FixedIncrements constraint #818

Closed
amontanez24 opened this issue May 24, 2022 · 0 comments · Fixed by #828
Closed

Create FixedIncrements constraint #818

amontanez24 opened this issue May 24, 2022 · 0 comments · Fixed by #828
Labels
feature request Request for a new feature
Milestone

Comments

@amontanez24
Copy link
Contributor

Problem Description

As a user, it would be useful to have a constraint that specifies the lowest common increment the data can appear in. For example, if my data must be a multiple of 5 or 7, it would be useful to be able to specify this.

Expected behavior

  • Remove the Rounding constraint. This functionality should be handled by the HyperTransformer
  • Add a FixedIncrements constraint
    • Init params should be:
      • column_name: String that is the name of the column to be constrained
      • increment_value: Int that is the value to make sure all data should be divisible by. Must be greater than 0.
    • Validation
      • If the increment_value is less than 0 or 0, we should raise an error during initialization.
      • If the data is not evenly divisible by the increment_value then that row is invalid
      • Nans should be ignored during validation
    • reverse_transform
      • Round synthesized values to nearest multiple of increment_value

Additional context

  • one option for transform is to divide all values by increment_value. Then on reverse you can round to the nearest int and just multiply.
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants