random(shape,
density=1.0,
rng=<bound method RandomUniform.rand of <parsimony.datasets.simula... ,
sort=False,
normalise=False)
| source code
|
Generates a random p-by-1 vector.
shape : A tuple. The shape of the underlying data. E.g., beta may represent
an underlying 2-by-3-by-4 image, and will in that case be 24-by-1.
density : A scalar in (0, 1]. The density of the returned regression vector
(fraction of non-zero elements). Zero-elements will be randomly
distributed in the vector. Default is 1.0.
rng : The random number generator. Must be a function that takes *shape as
input. Default is utils.RandomUniform in the interval [0, 1).
sort : A boolean. Whether or not to sort the vector. The vector is sorted
along the dimensions in order from the first. Default is False.
normalise : A boolean. Whether or not to normalise the vector. Default is
False.
|