|
Samples a random value from the Bernoulli distribution.
-
Returns:
float
|
|
Samples a random value from the Bernoulli distribution with the given probability.
-
prob
:
float
-
Returns:
float
|
|
Samples a value at random from the given array using the given categorical probabilities.
-
array
:
'a[]
-
probs
:
float[]
-
Returns:
'a
|
|
Samples a value at random from the given array.
-
array
:
'a[]
-
Returns:
'a
|
|
Samples an index at random with the given categorical probabilities.
-
probs
:
float[]
-
Returns:
int
|
|
Samples a double value in the given range [low, high)
-
low
:
float
-
high
:
float
-
Returns:
float
|
|
Samples a double value in the range [0, 1)
-
Returns:
float
|
|
Samples a random integer in the given range [low, high).
-
low
:
int
-
high
:
int
-
Returns:
int
|
|
Samples a non-negative random integer
-
Returns:
int
|
|
Returns a 2D array where each row contains `numSamples` indices sampled from the multinomial probability distribution defined by the probabilities in the corresponding row of the `probs` array.
-
probs
:
float[,]
-
numSamples
:
int
-
Returns:
int[,]
|
|
Samples a number of random values array of random values for the given weighted distribution
-
probs
:
float[]
-
numSamples
:
int
-
Returns:
int[]
|
|
Samples a random value from the normal distribution with the given mean and standard deviation.
-
mean
:
float
-
stddev
:
float
-
Returns:
float
|
|
Samples a random value from the standard normal distribution with mean 0 and standard deviation 1.
-
Returns:
float
|
|
Sets the random seed.
-
seed
:
int
|
|
Returns an array that is a randomly-shuffled version of the given array, using the Durstenfeld/Knuth shuffle.
-
array
:
'a[]
-
Returns:
'a[]
|
|
Returns a universally unique identifier (UUID) string
-
Returns:
string
|
|
Samples a random value from the uniform distribution with the given parameters [low, high).
-
low
:
float
-
high
:
float
-
Returns:
float
|
|
Samples a random value from the standard uniform distribution over the interval [0,1).
-
Returns:
float
|