python - Uniformly distributed data in d dimensions -
how can generate uniformly distributed [-1,1]^d data in python? e.g. d dimension 10.
i know how generate uniformly distributed data np.random.randn(n) dimension thing confused me lot.
assuming independence of individual coordinates, following generate random point in [-1, 1)^d
np.random.random(d) * 2 - 1
the following generate n
observations, each row observation
np.random.random((n, d)) * 2 - 1
Comments
Post a Comment