Skip to content

Sampling from a distribution #341

Answered by AlexMikhalev
verdverm asked this question in Q&A
Discussion options

You must be logged in to vote

You can adjust the frequency of categorical fields:

{
  "type": "string",
  "categorical": {
    "USD": 8,
    "GBP": 1,
    "EUR": 1
  }
}

USD will appear eight times more likely than GBP/EUR.
You can sample from the distribution:

{
  "type": "number",
  "subtype": "f64",
  "range": {
    "low": 274.4,
    "high": 6597.5,
    "step": 0.01
  }
}

or sample from data source:

{
  "type": "datasource",
  "path": "json:descriptions.json",
  "cycle": true
}

where descriptions

[
  "Walmart Credit Purchase",
  "Amazon - Kindle reading tablet",
  "Apple store subscription",
  "Google store rental",
  "Apple accessories",
  "Amazon Kindle subscription"
]

see Tweaking individual fields
I am conv…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AlexMikhalev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #325 on September 04, 2022 19:02.