Repository navigation
feat: synth distribution hints for numeric fields (normal, lognormal, exponential) - #460
Merged
Merged
Conversation
… exponential) Optional per-field distribution on integer and number fields. Uniform stays the default and the rows are unchanged without a hint. Draws outside min/max are redrawn. Validation ignores the hint. ODCS: x-cg-distribution customProperty (import and export). Python SDK reads and checks the hint. Docs and tests.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A user in the Bitol community asked whether synthetic data could follow a chosen distribution (mean and sd, or a skewed shape). Today synth draws evenly between
minandmax.What
Optional per-field
distributionhint forintegerandnumberfields:uniform(default; rows are identical to having no hint),normal(mean,sd),lognormal(mean,sdof the underlying normal, documented),exponential(rate, starts atminor 0).min/maxstill hold: draws outside are redrawn (truncation). Bounds that leave almost no mass fail withrule: distributionand the field named.distributionkey unless set).sd: 0, unknown type, missing or extra parameter) are rejected at parse time with a clear message; a hint on a non-numeric field fails synth naming the field.x-cg-distributionin a property'scustomProperties(import and export).No DB migration.
Not done
Dates and timestamps have no distribution hint (not cheap: they are generated as strings).
skewis covered bylognormalandexponential.Tests
tests/synth_distribution.rs(15): sample mean and sd within tolerance over 5,000 rows for normal, integer normal, lognormal (on the logs) and exponential; bounds; determinism; uniform unchanged; validator ignores the hint; error messages; ODCS round trip. Python SDK tests added.